[LU-17295] avoiding VFS exclusive locking on shared parent directory in ->atomic_open() Created: 17/Nov/23 Updated: 18/Dec/23 |
|
| Status: | Open |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Qian Yingjin | Assignee: | Qian Yingjin |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||
| Severity: | 3 | ||||
| Rank (Obsolete): | 9223372036854775807 | ||||
| Description |
|
This is an experimental feature to avoid the VFS exclusive locking on parent directory in ->atomic_open during file creations. It converted the exclusive semaphore mutex into a shared lock to avoid waiting for the heavy creation RPC to finished |
| Comments |
| Comment by Qian Yingjin [ 17/Nov/23 ] |
|
Found a possible bug in Lustre:
static int ll_atomic_open() /* VFS has locked the inode before calling this */ ll_set_inode_lock_owner(dir); As the dir maybe lock in shared mode, we may wrongly thought that the @dir is locked in exclusive mode:
if (open_flag & O_CREAT)
inode_lock(dir->d_inode);
else
inode_lock_shared(dir->d_inode);
error = lookup_open(nd, &path, file, op, got_write);
if (open_flag & O_CREAT)
inode_unlock(dir->d_inode);
else
inode_unlock_shared(dir->d_inode);
in vvp_inode_ops(), we may unlock the inode wrongly...
case COIO_INODE_UNLOCK: if (ll_get_inode_lock_owner(inode) == current) ll_inode_unlock(inode);
|
| Comment by Gerrit Updater [ 17/Nov/23 ] |
|
"Qian Yingjin <qian@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/53169 |