mm: always respect QUEUE_FLAG_STABLE_WRITES on the block device
Commit
1cb039f3dc16 ("bdi: replace BDI_CAP_STABLE_WRITES with a queue
and a sb flag") introduced a regression for the raw block device use
case. Capturing QUEUE_FLAG_STABLE_WRITES flag in set_bdev_super() has
the effect of respecting it only when there is a filesystem mounted on
top of the block device. Consequently, block devices that do integrity
checking return sporadic checksum errors when accessed directly.
Resurrect the original stable writes behavior by changing
folio_wait_stable() to account for the case of a raw block device.
Cc: stable@vger.kernel.org
Fixes: 1cb039f3dc16 ("bdi: replace BDI_CAP_STABLE_WRITES with a queue and a sb flag")
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>