[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0f2652ce-63e1-4399-8414-0bd150521e1b@oracle.com>
Date: Thu, 12 Sep 2024 15:58:00 +0100
From: John Garry <john.g.garry@...cle.com>
To: Christoph Hellwig <hch@....de>
Cc: axboe@...nel.dk, song@...nel.org, yukuai3@...wei.com, kbusch@...nel.org,
sagi@...mberg.me, James.Bottomley@...senPartnership.com,
martin.petersen@...cle.com, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-raid@...r.kernel.org,
linux-nvme@...ts.infradead.org, linux-scsi@...r.kernel.org
Subject: Re: [PATCH RFC 1/4] block: Make bdev_can_atomic_write() robust
against mis-aligned bdev size
On 12/09/2024 14:15, Christoph Hellwig wrote:
> On Tue, Sep 03, 2024 at 03:07:45PM +0000, John Garry wrote:
>> For bdev file operations, a write will be truncated when trying to write
>> past the end of the device. This could not be tolerated for an atomic
>> write.
>>
>> Ensure that the size of the bdev matches max atomic write unit so that this
>> truncation would never occur.
>
> But we'd still support atomic writes for all but the last sectors of
> the device?
We should do be able to, but with this patch we cannot. However, a
misaligned partition would be very much unexpected.
> Isn't this really an application problem?
Sure, if the application tried to do an atomic write to the end of the
device and it was truncated.
>
> If not supporting atomic writes at all for unaligned devices is the right
> thing to do, we'll need to clearly document this somewhere. Any maybe
> also add a pr_once to log a message?
I could also just reject any truncation on the atomic write in fops.
Maybe that is better.
And at some stage looking at making parted, fdisk, and other
partitioning tools atomic write aware would be good, so that the user
knows about these restrictions.
Thanks,
John
Powered by blists - more mailing lists