Skip to content

Commit 4eae06d

Browse files
amir73ilMiklos Szeredi
authored andcommitted
ovl: lockdep annotate of nested OVL_I(inode)->lock
This fixes a lockdep splat when mounting a nested overlayfs. Fixes: a015daf ("ovl: use ovl_inode mutex to synchronize...") Signed-off-by: Amir Goldstein <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
1 parent 39dae59 commit 4eae06d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/overlayfs/inode.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/posix_acl.h>
1515
#include <linux/ratelimit.h>
1616
#include "overlayfs.h"
17+
#include "ovl_entry.h"
1718

1819
int ovl_setattr(struct dentry *dentry, struct iattr *attr)
1920
{
@@ -409,6 +410,7 @@ static inline void ovl_lockdep_annotate_inode_mutex_key(struct inode *inode)
409410
#ifdef CONFIG_LOCKDEP
410411
static struct lock_class_key ovl_i_mutex_key[OVL_MAX_NESTING];
411412
static struct lock_class_key ovl_i_mutex_dir_key[OVL_MAX_NESTING];
413+
static struct lock_class_key ovl_i_lock_key[OVL_MAX_NESTING];
412414

413415
int depth = inode->i_sb->s_stack_depth - 1;
414416

@@ -419,6 +421,8 @@ static inline void ovl_lockdep_annotate_inode_mutex_key(struct inode *inode)
419421
lockdep_set_class(&inode->i_rwsem, &ovl_i_mutex_dir_key[depth]);
420422
else
421423
lockdep_set_class(&inode->i_rwsem, &ovl_i_mutex_key[depth]);
424+
425+
lockdep_set_class(&OVL_I(inode)->lock, &ovl_i_lock_key[depth]);
422426
#endif
423427
}
424428

0 commit comments

Comments
 (0)