Btrfs: disable FUA if mounted with nobarrier
authorOmar Sandoval <osandov@fb.com>
Wed, 6 Dec 2017 06:54:02 +0000 (22:54 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Feb 2018 10:08:00 +0000 (11:08 +0100)
commit27b0dc31686b212fb1996ece086a184d5eaac624
treedbee23bcbc43c88792a717cdde80edc090fc6a9a
parent8edc5b9772d04af3871f71c68aa8a5b468a27a72
Btrfs: disable FUA if mounted with nobarrier

[ Upstream commit 1b9e619c5bc8235cfba3dc4ced2fb0e3554a05d4 ]

I was seeing disk flushes still happening when I mounted a Btrfs
filesystem with nobarrier for testing. This is because we use FUA to
write out the first super block, and on devices without FUA support, the
block layer translates FUA to a flush. Even on devices supporting true
FUA, using FUA when we asked for no barriers is surprising.

Fixes: 387125fc722a8ed ("Btrfs: fix barrier flushes")
Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/disk-io.c