|
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.
|