From: "Darrick J. Wong" <djwong@kernel.org>
To: Alexander Monakov <amonakov@ispras.ru>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/2] xfs_db rdump: remove sole_path logic
Date: Thu, 20 Nov 2025 15:46:43 -0800 [thread overview]
Message-ID: <20251120234643.GM196370@frogsfrogsfrogs> (raw)
In-Reply-To: <7e7a4185-040d-b438-1821-bdb8b602f257@ispras.ru>
On Wed, Nov 12, 2025 at 10:45:37PM +0300, Alexander Monakov wrote:
>
> On Wed, 12 Nov 2025, Darrick J. Wong wrote:
>
> > On Wed, Nov 12, 2025 at 06:19:31PM +0300, Alexander Monakov wrote:
> > > Eliminate special handling of the case where rdump'ing one directory
> > > does not create the corresponding directory in the destination, but
> > > instead modifies the destination's attributes and creates children
> > > alongside the pre-existing children.
> >
> > It sounds like what happened is that you ran rdump with a non-empty
> > destdir, only to have rdump mutate the existing children in that
> > directory. Is that correct?
>
> Not really (what you describe would have been even worse).
>
> In my case, I was rdump'ing into a directory that had rtinherit set, and
> rdump undid that (generally speaking, all attributes of the destdir were
> overwritten, not just rtinherit).
>
> > If so, then I think what you really wanted was for rdump to check for
> > that and error out, unless explicit --overwrite permission had been
> > granted. Because...
>
> (I would still hit the above issue with attributes)
>
> > > This can be a trap for the unwary (the effect on attributes can be
> > > particularly surprising and non-trivial to undo), and, in general, fewer
> > > special cases in such a low-level tool should be desirable.
> >
> > ...I use this "special case" and don't understand why you decided that
> > removing functionality was the solution here. This is a filesystem
> > debugger, there are weird functions and sharp edges everywhere.
>
> Shouldn't we strive to have fewer surprises? For instance, if there was
> an explicit flag for that, there wouldn't be an issue.
>
> Out of curiosity, what is your use-case for this?
Copying build artifacts out of a directory on an xfs filesystem into
some other directory, e.g.
# xfs_db -c 'rdump /rootfs /srv/containers/whatever' /dev/sda1
Without then having to do:
# mv /srv/containers/whatever/rootfs/* /srv/containers/whatever/
# rmdir /srv/containers/whatever/rootfs
I'd be willing to accept more rsync-like behavior where a trailing slash
means "copy children directly into the target dir" and no trailing slash
means "create new child subdir in target dir and copy stuff into that".
IOWs,
xfs_db> rdump /rootfs /srv/containers/whatever
Would always create /srv/containers/whatever/rootfs and copy the
children of /rootfs into that path, but
xfs_db> rdump /rootfs/ /srv/containers/whatever/boot
Would copy the children of /rootfs directly into
/srv/containers/whatever/boot.
--D
> Thank you.
> Alexander
>
next prev parent reply other threads:[~2025-11-20 23:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-12 15:19 [PATCH 0/2] xfs_db rdump: papercut fixes Alexander Monakov
2025-11-12 15:19 ` [PATCH 1/2] xfs_db rdump: remove sole_path logic Alexander Monakov
2025-11-12 18:53 ` Darrick J. Wong
2025-11-12 19:45 ` Alexander Monakov
2025-11-20 23:46 ` Darrick J. Wong [this message]
2025-11-12 15:19 ` [PATCH 2/2] xfs_db: use push_cur_and_set_type more Alexander Monakov
2025-11-12 18:59 ` Darrick J. Wong
2025-11-12 19:18 ` Alexander Monakov
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=20251120234643.GM196370@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=amonakov@ispras.ru \
--cc=linux-xfs@vger.kernel.org \
/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