Skip to content

Commit

Permalink
fs/xfs: Remove unnecessary initialization of i_rwsem
Browse files Browse the repository at this point in the history
An earlier call of xfs_reinit_inode() from xfs_iget_cache_hit() already
handles initialization of i_rwsem.

Doing so again is unneeded.

Reviewed-by: Darrick J. Wong <[email protected]>
Reviewed-by: Dave Chinner <[email protected]>
Signed-off-by: Ira Weiny <[email protected]>

Signed-off-by: Darrick J. Wong <[email protected]>
  • Loading branch information
weiny2 authored and djwong committed May 4, 2020
1 parent 2f88f1e commit d45344d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/xfs/xfs_icache.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ xfs_iget_cache_hit(
spin_unlock(&ip->i_flags_lock);
rcu_read_unlock();

ASSERT(!rwsem_is_locked(&inode->i_rwsem));
error = xfs_reinit_inode(mp, inode);
if (error) {
bool wake;
Expand Down Expand Up @@ -456,9 +457,6 @@ xfs_iget_cache_hit(
ip->i_sick = 0;
ip->i_checked = 0;

ASSERT(!rwsem_is_locked(&inode->i_rwsem));
init_rwsem(&inode->i_rwsem);

spin_unlock(&ip->i_flags_lock);
spin_unlock(&pag->pag_ici_lock);
} else {
Expand Down

0 comments on commit d45344d

Please sign in to comment.