diff options
author | Chunwei Chen <[email protected]> | 2016-05-18 11:28:46 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-05-20 11:00:14 -0700 |
commit | fdbc1ba99d1f4d3958189079eee9b6c957e0264b (patch) | |
tree | dedfad932799dcfed78070207d66e8d231d0854f /module/spl/spl-vnode.c | |
parent | 39cd90ef08bb6817dd57ac08e9de5c87af2681ed (diff) |
Linux 4.7 compat: inode_lock() and friends
Linux 4.7 changes i_mutex to i_rwsem, and we should used inode_lock and
inode_lock_shared to do exclusive and shared lock respectively.
We use spl_inode_lock{,_shared}() to hide the difference. Note that on older
kernel you'll always take an exclusive lock.
We also add all other inode_lock friends. And nested users now should
explicitly call spl_inode_lock_nested with correct subclass.
Signed-off-by: Chunwei Chen <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Issue zfsonlinux/zfs#4665
Closes #549
Diffstat (limited to 'module/spl/spl-vnode.c')
-rw-r--r-- | module/spl/spl-vnode.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c index a914e046c..addc61155 100644 --- a/module/spl/spl-vnode.c +++ b/module/spl/spl-vnode.c @@ -352,7 +352,8 @@ spl_kern_path_locked(const char *name, struct path *path) if (rc) return (ERR_PTR(rc)); - spl_inode_lock(parent.dentry->d_inode); + /* use I_MUTEX_PARENT because vfs_unlink needs it */ + spl_inode_lock_nested(parent.dentry->d_inode, I_MUTEX_PARENT); dentry = lookup_one_len(basename, parent.dentry, len); if (IS_ERR(dentry)) { |