Skip to content

Commit d91eefd

Browse files
Robbie Kogregkh
Robbie Ko
authored andcommitted
btrfs: fix missing semaphore unlock in btrfs_sync_file
commit 6ff0672 upstream. Ordered ops are started twice in sync file, once outside of inode mutex and once inside, taking the dio semaphore. There was one error path missing the semaphore unlock. Fixes: aab15e8 ("Btrfs: fix rare chances for data loss when doing a fast fsync") CC: [email protected] # 4.19+ Signed-off-by: Robbie Ko <[email protected]> Reviewed-by: Filipe Manana <[email protected]> [ add changelog ] Signed-off-by: David Sterba <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9b8fda7 commit d91eefd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/btrfs/file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2134,6 +2134,7 @@ int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
21342134
*/
21352135
ret = start_ordered_ops(inode, start, end);
21362136
if (ret) {
2137+
up_write(&BTRFS_I(inode)->dio_sem);
21372138
inode_unlock(inode);
21382139
goto out;
21392140
}

0 commit comments

Comments
 (0)