]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
block: don't warn when doing fsync on read-only devices
authorMikulas Patocka <mpatocka@redhat.com>
Wed, 5 Sep 2018 22:14:36 +0000 (16:14 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Sep 2018 20:41:20 +0000 (22:41 +0200)
commitd927dea6392d5445a62f104baf8881ff5095d3ba
treeb8e48219f8a7b4f03157dd66e8e218b63a36864f
parent56935391aba9292b1b6a30e81c4f42495b3120b7
block: don't warn when doing fsync on read-only devices

commit 8b2ded1c94c06f841f8c1612bcfa33c85012a36b upstream.

It is possible to call fsync on a read-only handle (for example, fsck.ext2
does it when doing read-only check), and this call results in kernel
warning.

The patch b089cfd95d32 ("block: don't warn for flush on read-only device")
attempted to disable the warning, but it is buggy and it doesn't
(op_is_flush tests flags, but bio_op strips off the flags).

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Fixes: 721c7fc701c7 ("block: fail op_is_write() requests to read-only partitions")
Cc: stable@vger.kernel.org # 4.18
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
block/blk-core.c