diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2014-10-27 15:42:01 +0100 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2015-04-17 15:51:05 +0800 |
commit | 9ba0656673b59bcae46ce2a7849005a07d494fac (patch) | |
tree | 5e66b8c93677369eca7fc0dfdc84fa05be1d364f /include/linux/fs.h | |
parent | 2b3b22f12809d5406745005ea0c20c4945dfe789 (diff) |
overlayfs: fix lockdep misannotation
In an overlay directory that shadows an empty lower directory, say
/mnt/a/empty102, do:
touch /mnt/a/empty102/x
unlink /mnt/a/empty102/x
rmdir /mnt/a/empty102
It's actually harmless, but needs another level of nesting between
I_MUTEX_CHILD and I_MUTEX_NORMAL.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Tested-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
(cherry picked from commit d1b72cc6d8cb766c802fdc70a5edc2f0ba8a2b57)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 429af8d8f2a2..1ec29cc21c6f 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -641,11 +641,13 @@ static inline int inode_unhashed(struct inode *inode) * 2: child/target * 3: xattr * 4: second non-directory - * The last is for certain operations (such as rename) which lock two + * 5: second parent (when locking independent directories in rename) + * + * I_MUTEX_NONDIR2 is for certain operations (such as rename) which lock two * non-directories at once. * * The locking order between these classes is - * parent -> child -> normal -> xattr -> second non-directory + * parent[2] -> child -> grandchild -> normal -> xattr -> second non-directory */ enum inode_i_mutex_lock_class { @@ -653,7 +655,8 @@ enum inode_i_mutex_lock_class I_MUTEX_PARENT, I_MUTEX_CHILD, I_MUTEX_XATTR, - I_MUTEX_NONDIR2 + I_MUTEX_NONDIR2, + I_MUTEX_PARENT2, }; void lock_two_nondirectories(struct inode *, struct inode*); |