linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: djwong@kernel.org
Cc: linux-xfs@vger.kernel.org
Subject: [PATCHSET v23.1 0/9] xfs: clean up memory management in xattr scrub
Date: Sun, 02 Oct 2022 11:20:40 -0700	[thread overview]
Message-ID: <166473483982.1085108.101544412199880535.stgit@magnolia> (raw)

Hi all,

Currently, the extended attribute scrubber uses a single VLA to store
all the context information needed in various parts of the scrubber
code.  This includes xattr leaf block space usage bitmaps, and the value
buffer used to check the correctness of remote xattr value block
headers.  We try to minimize the insanity through the use of helper
functions, but this is a memory management nightmare.  Clean this up by
making the bitmap and value pointers explicit members of struct
xchk_xattr_buf.

Second, strengthen the xattr checking by teaching it to look for overlapping
data structures in the shortform attr data.

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=scrub-fix-xattr-memory-mgmt
---
 fs/xfs/scrub/attr.c  |  284 +++++++++++++++++++++++++++++++++++---------------
 fs/xfs/scrub/attr.h  |   60 +----------
 fs/xfs/scrub/scrub.c |    3 +
 fs/xfs/scrub/scrub.h |   10 ++
 4 files changed, 221 insertions(+), 136 deletions(-)


             reply	other threads:[~2022-10-02 18:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-02 18:20 Darrick J. Wong [this message]
2022-10-02 18:20 ` [PATCH 2/9] xfs: split freemap from xchk_xattr_buf.buf Darrick J. Wong
2022-10-02 18:20 ` [PATCH 4/9] xfs: split valuebuf " Darrick J. Wong
2022-10-02 18:20 ` [PATCH 5/9] xfs: remove flags argument from xchk_setup_xattr_buf Darrick J. Wong
2022-10-02 18:20 ` [PATCH 1/9] xfs: remove unnecessary dstmap in xattr scrubber Darrick J. Wong
2022-10-02 18:20 ` [PATCH 7/9] xfs: check used space of shortform xattr structures Darrick J. Wong
2022-10-02 18:20 ` [PATCH 3/9] xfs: split usedmap from xchk_xattr_buf.buf Darrick J. Wong
2022-10-02 18:20 ` [PATCH 6/9] xfs: move xattr scrub buffer allocation to top level function Darrick J. Wong
2022-10-02 18:20 ` [PATCH 9/9] xfs: only allocate free space bitmap for xattr scrub if needed Darrick J. Wong
2022-10-02 18:20 ` [PATCH 8/9] xfs: clean up xattr scrub initialization 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=166473483982.1085108.101544412199880535.stgit@magnolia \
    --to=djwong@kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).