]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: remove unnecessary memory barrier in btrfs_direct_IO
authorNikolay Borisov <nborisov@suse.com>
Tue, 1 Aug 2017 15:25:56 +0000 (18:25 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Aug 2017 16:49:21 +0000 (18:49 +0200)
commit2e0f45fa1a70928d223c4452cccc42704ca9a540
tree3a94053e30f88d9064f79a3afe5ffdcc937ab309
parent4fbbe95b77a5d38b7194d26752c32a2b9f8951b0
btrfs: remove unnecessary memory barrier in btrfs_direct_IO

Commit ca462ffc9340 ("Btrfs: implement unlocked dio write") implemented
unlocked dio write, allowing multiple dio writers to write to
non-overlapping, and non-eof-extending regions. In doing so it also
introduced a broken memory barrier. It is broken due to 2 things:

1. Memory barriers _MUST_ always be paired, this is clearly not the case
   here

2. Checkpatch actually produces a warning if a memory barrier is
   introduced that doesn't have a comment explaining how it's being
   paired.

Specifically for inode::i_dio_count that's wrapped inside
inode_dio_begin, there is no explicit barrier semantics attached, so
removing is fine as the atomic is used in common the waiter/wakeup
pattern.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ enhance changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c