Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux...
[sfrench/cifs-2.6.git] / fs / btrfs / tree-log.c
index 6d58d72705ae953a37123d3b764664d94f75bd84..286213cec86132188a9db6e687769902f06613a9 100644 (file)
@@ -4035,7 +4035,8 @@ again:
                if (ret < 0) {
                        err = ret;
                        goto out_unlock;
-               } if (ret) {
+               }
+               if (ret) {
                        ins_nr = 0;
                        btrfs_release_path(path);
                        continue;
@@ -4134,18 +4135,8 @@ log_extents:
                }
        }
 
-       write_lock(&em_tree->lock);
-       /*
-        * If we're doing a ranged fsync and there are still modified extents
-        * in the list, we must run on the next fsync call as it might cover
-        * those extents (a full fsync or an fsync for other range).
-        */
-       if (list_empty(&em_tree->modified_extents)) {
-               BTRFS_I(inode)->logged_trans = trans->transid;
-               BTRFS_I(inode)->last_log_commit =
-                       BTRFS_I(inode)->last_sub_trans;
-       }
-       write_unlock(&em_tree->lock);
+       BTRFS_I(inode)->logged_trans = trans->transid;
+       BTRFS_I(inode)->last_log_commit = BTRFS_I(inode)->last_sub_trans;
 out_unlock:
        if (unlikely(err))
                btrfs_put_logged_extents(&logged_list);