[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFwyCmYfUrGt61d-6B=1XiTLoudNO=_bQ9-g_rDg8Ao_VA@mail.gmail.com>
Date: Tue, 14 Aug 2018 09:22:10 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Ilya Dryomov <idryomov@...il.com>
Cc: stefan@...er.ch, Jens Axboe <axboe@...nel.dk>,
Sagi Grimberg <sagi@...mberg.me>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: Warning when using eMMC and partprobe: generic_make_request:
Trying to write to read-only block-device
On Tue, Aug 14, 2018 at 8:24 AM Ilya Dryomov <idryomov@...il.com> wrote:
>
> Looks like it's coming from that fsync():
>
> sys_fsync
> do_fsync
> vfs_fsync_range
> blkdev_fsync
> blkdev_issue_flush
>
> I think we need to teach blkdev_issue_flush() to bail out if the bdev
> is read-only, similar to blkdev_issue_discard(), _write_zeroes(), etc.
> The question is which error code to use. blkdev_fsync() already skips
> over EOPNOTSUPP, so it is a (no-so-good) option. Other blkdev_issue_
> functions return EPERM.
Oh, just make issue_flush() return EROFS for a read-only device.
Or maybe we should even just consider the flush to be a read operation?
But I guess the error code gets percolated all the way to user space?
The safest option might just be to return 0.
Linus
Powered by blists - more mailing lists