public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-xfs@vger.kernel.org, hch@lst.de
Subject: Re: [PATCH 6/6] xfs: create an xattr iteration function for scrub
Date: Wed, 28 Feb 2024 10:07:41 -0800	[thread overview]
Message-ID: <20240228180741.GL1927156@frogsfrogsfrogs> (raw)
In-Reply-To: <Zd9pLkEZUrmuizXW@infradead.org>

On Wed, Feb 28, 2024 at 09:11:10AM -0800, Christoph Hellwig wrote:
> On Mon, Feb 26, 2024 at 06:30:14PM -0800, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > Create a streamlined function to walk a file's xattrs, without all the
> > cursor management stuff in the regular listxattr.
> 
> So given that the Linux xattr interface doesn't have cursors

Which IMO is a deficiency that really ought to be rectified.  It's also
totally stupid that it returns E2BIG if the fs returned a list longer
than 64k even if the caller passed in a sufficiently large buffer.

>                                                              and they
> are only around for the XFS listattr by handle interface, why can't
> the normal listxattr syscall also use this cursors-less variant,
> which probably more efficient?  (assuming it is, maybe a little more
> explanation on why you've added this variant would be useful).

It's slightly more efficient since we don't have to keep the
xfs_attr_list_context updated or pay the initial "resynch" cost.  The
context itself is zero-initialized, so it'll pointlessly walk the leaf
entry array after loading the buffer.

The scrub listxattr implementation has the extra overhead of creating a
dabno bitmap while it walks multi-block attr structures so that it can't
get locked in a cycle.  xdabitmap_set can allocate memory for bitmap
records, which we might not want for code that userspace calls.

Another difficulty in porting xfs_vn_listxattr to use this is that we'd
have to hoist both this and xdabitmap out of scrub.

> No need to hold this series for optimizing regular listxattr, just
> thinking out loud here.

<nod> I guess we could share, but if I were to spend time on fixing
listxattr I'd rather upgrade the interface to use a cursor and gain the
ability to return more than 64k of names.

--D

  reply	other threads:[~2024-02-28 18:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-27  2:18 [PATCHSET v29.4 07/13] xfs: online repair of extended attributes Darrick J. Wong
2024-02-27  2:28 ` [PATCH 1/6] xfs: create a blob array data structure Darrick J. Wong
2024-02-28 16:00   ` Christoph Hellwig
2024-02-28 17:48     ` Darrick J. Wong
2024-02-27  2:29 ` [PATCH 2/6] xfs: use atomic extent swapping to fix user file fork data Darrick J. Wong
2024-02-28 16:01   ` Christoph Hellwig
2024-02-27  2:29 ` [PATCH 3/6] xfs: repair extended attributes Darrick J. Wong
2024-02-28 17:05   ` Christoph Hellwig
2024-02-27  2:29 ` [PATCH 4/6] xfs: scrub should set preen if attr leaf has holes Darrick J. Wong
2024-02-28 17:06   ` Christoph Hellwig
2024-02-27  2:29 ` [PATCH 5/6] xfs: flag empty xattr leaf blocks for optimization Darrick J. Wong
2024-02-28 17:06   ` Christoph Hellwig
2024-02-27  2:30 ` [PATCH 6/6] xfs: create an xattr iteration function for scrub Darrick J. Wong
2024-02-28 17:11   ` Christoph Hellwig
2024-02-28 18:07     ` Darrick J. Wong [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-12-31 19:30 [PATCHSET v29.0 20/28] xfs: online repair of extended attributes Darrick J. Wong
2023-12-31 20:36 ` [PATCH 6/6] xfs: create an xattr iteration function for scrub Darrick J. Wong

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=20240228180741.GL1927156@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    --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