Skip to content

Commit

Permalink
ufs: more deadlock prevention on tail unpacking
Browse files Browse the repository at this point in the history
->s_lock is not needed for ufs_change_blocknr()

Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Jun 15, 2017
1 parent 09bf4f5 commit 289dec5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ufs/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ u64 ufs_new_fragments(struct inode *inode, void *p, u64 fragment,
if (result) {
ufs_clear_frags(inode, result + oldcount, newcount - oldcount,
locked_page != NULL);
mutex_unlock(&UFS_SB(sb)->s_lock);
ufs_change_blocknr(inode, fragment - oldcount, oldcount,
uspi->s_sbbase + tmp,
uspi->s_sbbase + result, locked_page);
Expand All @@ -487,7 +488,6 @@ u64 ufs_new_fragments(struct inode *inode, void *p, u64 fragment,
UFS_I(inode)->i_lastfrag = max(UFS_I(inode)->i_lastfrag,
fragment + count);
write_sequnlock(&UFS_I(inode)->meta_lock);
mutex_unlock(&UFS_SB(sb)->s_lock);
if (newcount < request)
ufs_free_fragments (inode, result + newcount, request - newcount);
ufs_free_fragments (inode, tmp, oldcount);
Expand Down

0 comments on commit 289dec5

Please sign in to comment.