Skip to content
Commit bc36dfff authored by Jan Kara's avatar Jan Kara
Browse files

ext2: Silence lockdep warning about reclaim under xattr_sem



Lockdep complains about a chain:
  sb_internal#2 --> &ei->xattr_sem#2 --> fs_reclaim

and shrink_dentry_list -> ext2_evict_inode -> ext2_xattr_delete_inode ->
down_write(ei->xattr_sem) creating a locking cycle in the reclaim path.
This is however a false positive because when we are in
ext2_evict_inode() we are the only holder of the inode reference and
nobody else should touch xattr_sem of that inode. So we cannot ever
block on acquiring the xattr_sem in the reclaim path.

Silence the lockdep warning by using down_write_trylock() in
ext2_xattr_delete_inode() to not create false locking dependency.

Reported-by: default avatar"J. R. Okajima" <hooanon05g@gmail.com>
Reviewed-by: default avatarRitesh Harjani <riteshh@linux.ibm.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent f8788d86
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment