From: Hannes Reinecke <hare@suse.de>
To: John Garry <john.g.garry@oracle.com>, Christoph Hellwig <hch@lst.de>
Cc: axboe@kernel.dk, song@kernel.org, yukuai3@huawei.com,
kbusch@kernel.org, sagi@grimberg.me,
James.Bottomley@HansenPartnership.com,
martin.petersen@oracle.com, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org,
linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH RFC 1/4] block: Make bdev_can_atomic_write() robust against mis-aligned bdev size
Date: Fri, 13 Sep 2024 10:36:30 +0200 [thread overview]
Message-ID: <a8e47dd4-26f4-49da-9ba8-aad2e8fcf9b1@suse.de> (raw)
In-Reply-To: <4a015015-ae7f-4eb5-ad00-420db5961d96@oracle.com>
On 9/12/24 17:22, John Garry wrote:
> On 12/09/2024 16:07, Christoph Hellwig wrote:
>>> We should do be able to, but with this patch we cannot. However, a
>>> misaligned partition would be very much unexpected.
>> Yes, misaligned partitions is very unexpected, but with large and
>> potentially unlimited atomic boundaries I would not expect the size
>> to always be aligned. But then again at least in NVMe atomic writes
>> don't need to match the max size anyway, so I'm not entirely sure
>> what the problem actually is.
>
> Actually it's not an alignment issue, but a size issue.
>
> Consider a 3.5MB partition and atomic write max is 1MB. If we tried to
> atomic write 1MB at offset 3MB, then it would be truncated to a 0.5MB
> write.
>
> So maybe it is an application bug.
>
Hmm. Why don't we reject such an I/O? We cannot guarantee an atomic
write, so I think we should be perfectly fine to return an error to
userspace.
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
next prev parent reply other threads:[~2024-09-13 8:36 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-03 15:07 [PATCH RFC 0/4] RAID0 atomic write support John Garry
2024-09-03 15:07 ` [PATCH RFC 1/4] block: Make bdev_can_atomic_write() robust against mis-aligned bdev size John Garry
2024-09-12 13:15 ` Christoph Hellwig
2024-09-12 14:58 ` John Garry
2024-09-12 15:07 ` Christoph Hellwig
2024-09-12 15:22 ` John Garry
2024-09-13 8:36 ` Hannes Reinecke [this message]
2024-09-03 15:07 ` [PATCH RFC 2/4] block: Add BLK_FEAT_ATOMIC_WRITES flag John Garry
2024-09-12 13:16 ` Christoph Hellwig
2024-09-12 14:58 ` John Garry
2024-09-03 15:07 ` [PATCH RFC 3/4] block: Support atomic writes limits for stacked devices John Garry
2024-09-12 13:16 ` Christoph Hellwig
2024-09-12 15:05 ` John Garry
2024-09-03 15:07 ` [PATCH RFC 4/4] md/raid0: Atomic write support John Garry
2024-09-12 13:18 ` Christoph Hellwig
2024-09-12 14:48 ` John Garry
2024-09-12 15:10 ` Christoph Hellwig
2024-09-12 15:38 ` John Garry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a8e47dd4-26f4-49da-9ba8-aad2e8fcf9b1@suse.de \
--to=hare@suse.de \
--cc=James.Bottomley@HansenPartnership.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=john.g.garry@oracle.com \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-raid@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sagi@grimberg.me \
--cc=song@kernel.org \
--cc=yukuai3@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox