mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shaopei Zhu <shaopei_1012@163.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Namjae Jeon <linkinjeon@kernel.org>,
	Sungjong Seo <sj1557.seo@samsung.com>,
	Yuezhang Mo <yuezhang.mo@sony.com>,
	exfat@lists.linux.dev, linux-fsdevel@vger.kernel.org,
	linux-api@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] exfat: add EXFAT_IOC_COMBINE to append a file's clusters to another
Date: Wed, 25 Nov 2026 02:19:11 +0800	[thread overview]
Message-ID: <20261124181911.773506-1-shaopei_1012@163.com> (raw)
In-Reply-To: <awXMJaZ58iS3K2N0@casper.infradead.org>

On Tue, Nov 24, 2026 at 05:40:53PM +0000, Matthew Wilcox wrote:
> On Tue, Nov 24, 2026 at 10:28:07PM +0800, Shaopei Zhu wrote:
> > As with EXT4_IOC_MOVE_EXT and F2FS_IOC_MOVE_RANGE, the source must be
> > open for reading and writing, the destination for writing, and both must
> > be regular files on the same mount.  Files whose allocation, chain
> > layout or valid_size are inconsistent, as after a failed truncate or on
> > a corrupt volume, are refused with -EIO before anything is changed.
>
> Why are you designing your own ioctl instead of implementing
> EXT4_IOC_MOVE_EXT in exfat?  That's the normal way of doing things as
> it lets us later hoist the ioctl from all the filesystems implementing
> it to the VFS.

Hi Matthew,

Thanks for looking at this.  That paragraph was badly worded: I only
meant that the permission rules are the same as for those ioctls, not
that the operation is similar.

EXT4_IOC_MOVE_EXT is a defragmentation primitive: it copies the data of
the original file into the donor's blocks and exchanges the block
mappings, so the contents and sizes of both files stay the same, and
the range has to lie within both files.  It cannot append one file to
another, which is what is needed here: the clusters of the source are
linked onto the end of the destination, the destination grows and the
source is unlinked, without copying any data.

I will reword that paragraph in the next version so that it states the
rules without suggesting that the operations are related.

Thanks,
Shaopei


  reply	other threads:[~2026-11-24 18:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 14:28 Shaopei Zhu
2026-11-24 17:40 ` Matthew Wilcox
2026-11-24 18:19   ` Shaopei Zhu [this message]
2026-11-24 20:23   ` Shaopei Zhu

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=20261124181911.773506-1-shaopei_1012@163.com \
    --to=shaopei_1012@163.com \
    --cc=exfat@lists.linux.dev \
    --cc=linkinjeon@kernel.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sj1557.seo@samsung.com \
    --cc=willy@infradead.org \
    --cc=yuezhang.mo@sony.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

all inboxes | Powered by JetHome®