diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/inode.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/fs/inode.c b/fs/inode.c index f643be565df8..04c785bb63c3 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -665,12 +665,17 @@ void unlock_new_inode(struct inode *inode) | |||
665 | if (inode->i_mode & S_IFDIR) { | 665 | if (inode->i_mode & S_IFDIR) { |
666 | struct file_system_type *type = inode->i_sb->s_type; | 666 | struct file_system_type *type = inode->i_sb->s_type; |
667 | 667 | ||
668 | /* | 668 | /* Set new key only if filesystem hasn't already changed it */ |
669 | * ensure nobody is actually holding i_mutex | 669 | if (!lockdep_match_class(&inode->i_mutex, |
670 | */ | 670 | &type->i_mutex_key)) { |
671 | mutex_destroy(&inode->i_mutex); | 671 | /* |
672 | mutex_init(&inode->i_mutex); | 672 | * ensure nobody is actually holding i_mutex |
673 | lockdep_set_class(&inode->i_mutex, &type->i_mutex_dir_key); | 673 | */ |
674 | mutex_destroy(&inode->i_mutex); | ||
675 | mutex_init(&inode->i_mutex); | ||
676 | lockdep_set_class(&inode->i_mutex, | ||
677 | &type->i_mutex_dir_key); | ||
678 | } | ||
674 | } | 679 | } |
675 | #endif | 680 | #endif |
676 | /* | 681 | /* |