lkml.org 
[lkml]   [2018]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Warning when using eMMC and partprobe: generic_make_request: Trying to write to read-only block-device
From
Date
On 8/14/18 10:22 AM, Linus Torvalds wrote:
> On Tue, Aug 14, 2018 at 8:24 AM Ilya Dryomov <idryomov@gmail.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.

We probably just want to special case a flush for this check. In other
situations, like resource allocation and issue, we'd want to consider
it a write.

--
Jens Axboe

\
 
 \ /
  Last update: 2018-08-14 18:25    [W:0.043 / U:0.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site