]> git.baikalelectronics.ru Git - kernel.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)
committerJens Axboe <axboe@kernel.dk>
Wed, 5 Sep 2018 22:14:36 +0000 (16:14 -0600)
commit0c1e872debca6bd45871d3a1d921db907641d1f0
treea53368fb013c47854de1fc6d18a97e59a1390232
parent9ee99650764966a97f573c723032f0fba3ac15ae
block: don't warn when doing fsync on read-only devices

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 ea6e80c9ca4d ("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: 6ed2faa4117a ("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>
block/blk-core.c