OSDN Git Service

btrfs: use appropriate replacements for __sb_{start,end}_write calls
authorRakesh Pandit <rakesh@tuxera.com>
Tue, 10 Oct 2017 10:48:05 +0000 (13:48 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 30 Oct 2017 11:27:58 +0000 (12:27 +0100)
Commit a53f4f8e9c8eb ("btrfs: Don't call btrfs_start_transaction() on
frozen fs to avoid deadlock.") started using internal calls and we
replace them with more suitable ones.

Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/super.c

index f092fe0..770ac08 100644 (file)
@@ -1205,8 +1205,8 @@ int btrfs_sync_fs(struct super_block *sb, int wait)
                         * happens. The pending operations are delayed to the
                         * next commit after thawing.
                         */
-                       if (__sb_start_write(sb, SB_FREEZE_WRITE, false))
-                               __sb_end_write(sb, SB_FREEZE_WRITE);
+                       if (sb_start_write_trylock(sb))
+                               sb_end_write(sb);
                        else
                                return 0;
                        trans = btrfs_start_transaction(root, 0);