Btrfs: fix missing semaphore unlock
PATCH 1/1 Btrfs: fix missing semaphore unlock
From: Robbie Ko <[email protected]>
Fixes aab15e8ec2576 ("Btrfs: fix rare chances for data loss when doing a fast fsync")
Signed-off-by Robbie Ko <[email protected]>
--- fs/btrfs/file.c | 1 + 1 file changed, 1 insertion(+)
fs/btrfs/file.c +1 -0
@@ -2124,6 +2124,7 @@ int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)*/ ret =start_ordered_ops (inode, start, end);if (ret) { +up_write (&BTRFS_I (inode)->dio_sem);inode_unlock (inode); goto out; }
Signature · 1 line
2.17.1
Quoted 5 lines · robbieko
From: Robbie Ko <[email protected]>
Fixes aab15e8ec2576 ("Btrfs: fix rare chances for data loss when doing a fast fsync")Signed-off-by Robbie Ko <[email protected]>
Reviewed-by Filipe Manana <[email protected]>
Looks good, thanks.
Quoted 19 lines
--- fs/btrfs/file.c | 1 + 1 file changed, 1 insertion(+)fs/btrfs/file.c +1
-1@@ -2124,6 +2124,7 @@ int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)*/ ret =start_ordered_ops (inode, start, end);if (ret) { +up_write (&BTRFS_I (inode)->dio_sem);inode_unlock (inode); goto out; } --2.17.1
Signature · 3 lines
Filipe David Manana, “Whether you think you can, or you think you can't — you're right.”
Quoted 1 line · robbieko
From: Robbie Ko <[email protected]>
This is not a trivial patch that could go without a changelog.
Quoted 11 lines
Fixes aab15e8ec2576 ("Btrfs: fix rare chances for data loss when doing a fast fsync")Signed-off-by Robbie Ko <[email protected]>--- fs/btrfs/file.c | 1 + 1 file changed, 1 insertion(+)fs/btrfs/file.c +0
-0
fs/btrfs/file.c int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync) · line 2127
Quoted 4 lines
fs/btrfs/file.c +1
-0@@ -2124,6 +2124,7 @@ int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)*/ ret =start_ordered_ops (inode, start, end);if (ret) { +up_write (&BTRFS_I (inode)->dio_sem);
I did not spot on first sight that there's was missing semaphore unlock and a few lines below there's down_write(dio_sem). Turns out there are two calls to start_ordered_ops, one before dio_sem and one inside the locked section. So I solved the puzzle but I'd prefer not having to and get a patch with instructions.