Skip to content

Commit

Permalink
f2fs: adjust unlock order for cleanup
Browse files Browse the repository at this point in the history
This patch adjusts unlock order of .i_mmap_sem and .i_gc_rwsem for
cleanup.

Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
  • Loading branch information
Chao Yu authored and Jaegeuk Kim committed Aug 30, 2021
1 parent 4d67490 commit d75da8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/f2fs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -3497,8 +3497,8 @@ static int f2fs_release_compress_blocks(struct file *filp, unsigned long arg)
released_blocks += ret;
}

up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
up_write(&F2FS_I(inode)->i_mmap_sem);
up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
out:
inode_unlock(inode);

Expand Down Expand Up @@ -3650,8 +3650,8 @@ static int f2fs_reserve_compress_blocks(struct file *filp, unsigned long arg)
reserved_blocks += ret;
}

up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
up_write(&F2FS_I(inode)->i_mmap_sem);
up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);

if (ret >= 0) {
clear_inode_flag(inode, FI_COMPRESS_RELEASED);
Expand Down

0 comments on commit d75da8c

Please sign in to comment.