[LU-7177] First write RPC may set stale ownership to the OST object Created: 17/Sep/15  Updated: 17/Sep/15  Resolved: 17/Sep/15

Status: Closed
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Niu Yawei (Inactive) Assignee: Niu Yawei (Inactive)
Resolution: Not a Bug Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

When the first write RPC arrives OST, it calls ofd_write_attr_set() -> ofd_attr_handle_ugid() to check if S_ISUID or S_ISGID is present, if the flag is present, it assumes the object is just pre-created without proper uid/gid setting, and it'll set the uid/gid carried from client to initialize the ownership of the object.

However, there isn't any locking in ofd_attr_handle_ugid() to serialize the ownership changing by first write and real chown/chgrp calls, that could lead to the first write overwrite the correct ownership set by chown/chgrp with stale one.

I think a ofd_write_lock() could be introduced in ofd_attr_handle_ugid() to eliminate such race.



 Comments   
Comment by Niu Yawei (Inactive) [ 17/Sep/15 ]

OST write is covered by ofd_read_lock(), the race doesn't exist.

Generated at Sat Feb 10 02:06:39 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.