restore killability of old mutex_lock_killable(&inode->i_mutex) users

The ones that are taking it exclusive, that is...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro 2016-05-26 00:05:12 -04:00
parent 887bddfa90
commit 002354112f
3 changed files with 14 additions and 20 deletions

View File

@ -846,11 +846,9 @@ static noinline int btrfs_mksubvol(struct path *parent,
struct dentry *dentry; struct dentry *dentry;
int error; int error;
inode_lock_nested(dir, I_MUTEX_PARENT); error = down_write_killable_nested(&dir->i_rwsem, I_MUTEX_PARENT);
// XXX: should've been if (error == -EINTR)
// mutex_lock_killable_nested(&dir->i_mutex, I_MUTEX_PARENT); return error;
// if (error == -EINTR)
// return error;
dentry = lookup_one_len(name, parent->dentry, namelen); dentry = lookup_one_len(name, parent->dentry, namelen);
error = PTR_ERR(dentry); error = PTR_ERR(dentry);
@ -2377,11 +2375,9 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
goto out; goto out;
inode_lock_nested(dir, I_MUTEX_PARENT); err = down_write_killable_nested(&dir->i_rwsem, I_MUTEX_PARENT);
// XXX: should've been if (err == -EINTR)
// err = mutex_lock_killable_nested(&dir->i_mutex, I_MUTEX_PARENT); goto out_drop_write;
// if (err == -EINTR)
// goto out_drop_write;
dentry = lookup_one_len(vol_args->name, parent, namelen); dentry = lookup_one_len(vol_args->name, parent, namelen);
if (IS_ERR(dentry)) { if (IS_ERR(dentry)) {
err = PTR_ERR(dentry); err = PTR_ERR(dentry);
@ -2571,7 +2567,7 @@ out_dput:
dput(dentry); dput(dentry);
out_unlock_dir: out_unlock_dir:
inode_unlock(dir); inode_unlock(dir);
//out_drop_write: out_drop_write:
mnt_drop_write_file(file); mnt_drop_write_file(file);
out: out:
kfree(vol_args); kfree(vol_args);

View File

@ -218,9 +218,7 @@ static int ovl_check_whiteouts(struct dentry *dir, struct ovl_readdir_data *rdd)
cap_raise(override_cred->cap_effective, CAP_DAC_OVERRIDE); cap_raise(override_cred->cap_effective, CAP_DAC_OVERRIDE);
old_cred = override_creds(override_cred); old_cred = override_creds(override_cred);
inode_lock(dir->d_inode); err = down_write_killable(&dir->d_inode->i_rwsem);
err = 0;
// XXX: err = mutex_lock_killable(&dir->d_inode->i_mutex);
if (!err) { if (!err) {
while (rdd->first_maybe_whiteout) { while (rdd->first_maybe_whiteout) {
p = rdd->first_maybe_whiteout; p = rdd->first_maybe_whiteout;

View File

@ -35,13 +35,13 @@ int iterate_dir(struct file *file, struct dir_context *ctx)
if (res) if (res)
goto out; goto out;
if (shared) if (shared) {
inode_lock_shared(inode); inode_lock_shared(inode);
else } else {
inode_lock(inode); res = down_write_killable(&inode->i_rwsem);
// res = mutex_lock_killable(&inode->i_mutex); if (res)
// if (res) goto out;
// goto out; }
res = -ENOENT; res = -ENOENT;
if (!IS_DEADDIR(inode)) { if (!IS_DEADDIR(inode)) {