diff options
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r-- | fs/btrfs/super.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 8c6e61d6eed5..83d6f9f9c220 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -100,10 +100,6 @@ static void __save_error_info(struct btrfs_fs_info *fs_info) | |||
100 | fs_info->fs_state = BTRFS_SUPER_FLAG_ERROR; | 100 | fs_info->fs_state = BTRFS_SUPER_FLAG_ERROR; |
101 | } | 101 | } |
102 | 102 | ||
103 | /* NOTE: | ||
104 | * We move write_super stuff at umount in order to avoid deadlock | ||
105 | * for umount hold all lock. | ||
106 | */ | ||
107 | static void save_error_info(struct btrfs_fs_info *fs_info) | 103 | static void save_error_info(struct btrfs_fs_info *fs_info) |
108 | { | 104 | { |
109 | __save_error_info(fs_info); | 105 | __save_error_info(fs_info); |
@@ -842,7 +838,6 @@ int btrfs_sync_fs(struct super_block *sb, int wait) | |||
842 | struct btrfs_trans_handle *trans; | 838 | struct btrfs_trans_handle *trans; |
843 | struct btrfs_fs_info *fs_info = btrfs_sb(sb); | 839 | struct btrfs_fs_info *fs_info = btrfs_sb(sb); |
844 | struct btrfs_root *root = fs_info->tree_root; | 840 | struct btrfs_root *root = fs_info->tree_root; |
845 | int ret; | ||
846 | 841 | ||
847 | trace_btrfs_sync_fs(wait); | 842 | trace_btrfs_sync_fs(wait); |
848 | 843 | ||
@@ -853,11 +848,17 @@ int btrfs_sync_fs(struct super_block *sb, int wait) | |||
853 | 848 | ||
854 | btrfs_wait_ordered_extents(root, 0, 0); | 849 | btrfs_wait_ordered_extents(root, 0, 0); |
855 | 850 | ||
856 | trans = btrfs_start_transaction(root, 0); | 851 | spin_lock(&fs_info->trans_lock); |
852 | if (!fs_info->running_transaction) { | ||
853 | spin_unlock(&fs_info->trans_lock); | ||
854 | return 0; | ||
855 | } | ||
856 | spin_unlock(&fs_info->trans_lock); | ||
857 | |||
858 | trans = btrfs_join_transaction(root); | ||
857 | if (IS_ERR(trans)) | 859 | if (IS_ERR(trans)) |
858 | return PTR_ERR(trans); | 860 | return PTR_ERR(trans); |
859 | ret = btrfs_commit_transaction(trans, root); | 861 | return btrfs_commit_transaction(trans, root); |
860 | return ret; | ||
861 | } | 862 | } |
862 | 863 | ||
863 | static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry) | 864 | static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry) |
@@ -1534,6 +1535,8 @@ static int btrfs_show_devname(struct seq_file *m, struct dentry *root) | |||
1534 | while (cur_devices) { | 1535 | while (cur_devices) { |
1535 | head = &cur_devices->devices; | 1536 | head = &cur_devices->devices; |
1536 | list_for_each_entry(dev, head, dev_list) { | 1537 | list_for_each_entry(dev, head, dev_list) { |
1538 | if (dev->missing) | ||
1539 | continue; | ||
1537 | if (!first_dev || dev->devid < first_dev->devid) | 1540 | if (!first_dev || dev->devid < first_dev->devid) |
1538 | first_dev = dev; | 1541 | first_dev = dev; |
1539 | } | 1542 | } |