]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blobdiff - fs/btrfs/file.c
Btrfs: fix unprotected ->log_batch
[mirror_ubuntu-eoan-kernel.git] / fs / btrfs / file.c
index a9d7815cf58e5d4d1a23beeb158b88a42e4a9dc2..793bc89c660ff86aee1cfda47d1e5d7bdaf200fd 100644 (file)
@@ -1551,9 +1551,9 @@ int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
         * ordered range does a filemape_write_and_wait_range which is why we
         * don't do it above like other file systems.
         */
-       root->log_batch++;
+       atomic_inc(&root->log_batch);
        btrfs_wait_ordered_range(inode, start, end);
-       root->log_batch++;
+       atomic_inc(&root->log_batch);
 
        /*
         * check the transaction that last modified this inode