All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs: don't expose misaligned extszinherit hints to userspace
Date: Fri, 9 Jul 2021 07:25:09 +0100	[thread overview]
Message-ID: <YOfrxV9p1Bhrs1jD@infradead.org> (raw)
In-Reply-To: <20210709041209.GO11588@locust>

On Thu, Jul 08, 2021 at 09:12:09PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Commit 603f000b15f2 changed xfs_ioctl_setattr_check_extsize to reject an
> attempt to set an EXTSZINHERIT extent size hint on a directory with
> RTINHERIT set if the hint isn't a multiple of the realtime extent size.
> However, I have recently discovered that it is possible to change the
> realtime extent size when adding a rt device to a filesystem, which
> means that the existence of directories with misaligned inherited hints
> is not an accident.
> 
> As a result, it's possible that someone could have set a valid hint and
> added an rt volume with a different rt extent size, which invalidates
> the ondisk hints.  After such a sequence, FSGETXATTR will report a
> misaligned hint, which FSSETXATTR will trip over, causing confusion if
> the user was doing the usual GET/SET sequence to change some other
> attribute.  Change xfs_fill_fsxattr to omit the hint if it isn't aligned
> properly.

Looks sensible, but maybe we need a pr_info_ratelimited to inform
the user of this case?

  parent reply	other threads:[~2021-07-09  6:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-09  4:12 [PATCH] xfs: don't expose misaligned extszinherit hints to userspace Darrick J. Wong
2021-07-09  4:14 ` [RFC PATCH] xfs: test adding realtime sections to filesystem Darrick J. Wong
2021-07-09  6:25 ` Christoph Hellwig [this message]
2021-07-10  3:58   ` [PATCH] xfs: don't expose misaligned extszinherit hints to userspace Darrick J. Wong
2021-07-12 11:22     ` Christoph Hellwig

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=YOfrxV9p1Bhrs1jD@infradead.org \
    --to=hch@infradead.org \
    --cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.