parallel lookups: actual switch to rwsem
ta-da! The main issue is the lack of down_write_killable(), so the places like readdir.c switched to plain inode_lock(); once killable variants of rwsem primitives appear, that'll be dealt with. lockdep side also might need more work Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -837,9 +837,11 @@ static noinline int btrfs_mksubvol(struct path *parent,
|
||||
struct dentry *dentry;
|
||||
int error;
|
||||
|
||||
error = mutex_lock_killable_nested(&dir->i_mutex, I_MUTEX_PARENT);
|
||||
if (error == -EINTR)
|
||||
return error;
|
||||
inode_lock_nested(dir, I_MUTEX_PARENT);
|
||||
// XXX: should've been
|
||||
// mutex_lock_killable_nested(&dir->i_mutex, I_MUTEX_PARENT);
|
||||
// if (error == -EINTR)
|
||||
// return error;
|
||||
|
||||
dentry = lookup_one_len(name, parent->dentry, namelen);
|
||||
error = PTR_ERR(dentry);
|
||||
@@ -2366,9 +2368,11 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
|
||||
goto out;
|
||||
|
||||
|
||||
err = mutex_lock_killable_nested(&dir->i_mutex, I_MUTEX_PARENT);
|
||||
if (err == -EINTR)
|
||||
goto out_drop_write;
|
||||
inode_lock_nested(dir, I_MUTEX_PARENT);
|
||||
// XXX: should've been
|
||||
// err = mutex_lock_killable_nested(&dir->i_mutex, I_MUTEX_PARENT);
|
||||
// if (err == -EINTR)
|
||||
// goto out_drop_write;
|
||||
dentry = lookup_one_len(vol_args->name, parent, namelen);
|
||||
if (IS_ERR(dentry)) {
|
||||
err = PTR_ERR(dentry);
|
||||
@@ -2558,7 +2562,7 @@ out_dput:
|
||||
dput(dentry);
|
||||
out_unlock_dir:
|
||||
inode_unlock(dir);
|
||||
out_drop_write:
|
||||
//out_drop_write:
|
||||
mnt_drop_write_file(file);
|
||||
out:
|
||||
kfree(vol_args);
|
||||
|
Reference in New Issue
Block a user