public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Dave Chinner <david@fromorbit.com>
Cc: Nick Bowler <nbowler@draconx.ca>,
	Brian Foster <bfoster@redhat.com>,
	linux-xfs@vger.kernel.org
Subject: Re: Enlarging w/ xfs_growfs: XFS_IOC_FSGROWFSDATA xfsctl failed: Inappropriate ioctl for device
Date: Thu, 13 Dec 2018 08:30:08 -0800	[thread overview]
Message-ID: <20181213163008.GC24487@magnolia> (raw)
In-Reply-To: <20181213035352.GF6311@dastard>

On Thu, Dec 13, 2018 at 02:53:52PM +1100, Dave Chinner wrote:
> On Tue, Dec 11, 2018 at 11:56:33PM -0500, Nick Bowler wrote:
> > On 12/11/18, Brian Foster <bfoster@redhat.com> wrote:
> > > On Tue, Dec 11, 2018 at 02:04:48AM -0500, Nick Bowler wrote:
> > >> Hi Dave,
> > >>
> > >> On 2018-12-10, Dave Chinner <david@fromorbit.com> wrote:
> > >> > On Mon, Dec 10, 2018 at 03:54:47PM -0500, Nick Bowler wrote:
> > >> >> I can have a go at fixing the FSGEOMETRY ioctl too (and submit it
> > >> >> properly) if this approach seems reasonable.  Possibly other things
> > >> >> may be broken too but I haven't hit any other issues yet in my XFS
> > >> >> adventure.
> > >> >
> > >> > We really need to audit all the compat ioctls for this same
> > >> > problem and fix all of them in one go, not just slap a bandaid on
> > >> > the messenger and ignore the rest....
> > >>
> > >> OK then.  This patch should cover all of them.  However, I wouldn't know
> > >> where to start with verification of a change like this, since I don't
> > >> know what these ioctls actually do, but xfs_growfs does seem to work for
> > >> me now on a test filesystem with this applied.
> > >>
> > >
> > > Given that the structure size essentially changes the command value, I'm
> > > kind of curious why we have this ifdeffery in the first place. That
> > > aside, the patch seems reasonable to me at a glance (though some brief
> > > comments around the ifdefs would be nice).
> > 
> > OK, xfstests has revealed some trouble with the three "bulkstat" ioctls,
> > since while the xfs_bulkstat structure itself is fine, one of its members
> > is used as a pointer to various structures which are not fine.  This
> > wasn't too hard to fix though.
> 
> IIRC, there's bigger problems than you realise here - the bulkstat
> structure has embedded timestamps in them and on x32 struct timeval
> doesn't match either ia32 or x86-64. i.e. on ia32, struct timeval is
> 8 bytes, on x86-64 it is 16 bytes, and in x32 it is 12 bytes.
> 
> IOWs, using the x86-64 handlers for bulkstat is wrong, as is using
> the compat handlers. That's one of the reasons why x32 is such a
> Charlie Foxtrot when it comes to compat handlers - we basically have
> to audit ioctl structures one by one with pahole to determine which
> arch version they *may* be compatible with.
> 
> And then there is testing that we get identical output from all
> three versions for each ioctl.
> 
> Right now, I'd much prefer we simply put this at the start of
> xfs_fs_fill_super():
> 
> #ifdef CONFIG_X86_X32
> 	xfs_warn("XFS not supported on x32 architectures")
> 	return -ENOSYS;
> #endif
> 
> Or, alternatively, tag it as EXPERIMENTAL and "use at your own
> risk".

You(r distro) can enable X32 in the x86_64 kernel even if you never use
it, so this as proposed would break XFS on amd64.  I'd rather just have
something like this in xfs_file_ioctl, and gated on is_x32_syscall().

--D

> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@fromorbit.com

      parent reply	other threads:[~2018-12-13 16:30 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-10  4:29 Enlarging w/ xfs_growfs: XFS_IOC_FSGROWFSDATA xfsctl failed: Inappropriate ioctl for device Nick Bowler
2018-12-10 14:33 ` Brian Foster
2018-12-10 15:39   ` Nick Bowler
2018-12-10 16:11     ` Brian Foster
2018-12-10 16:50       ` Darrick J. Wong
2018-12-10 16:55         ` Darrick J. Wong
2018-12-10 17:46         ` Brian Foster
2018-12-10 20:54           ` Nick Bowler
2018-12-10 21:41             ` Dave Chinner
2018-12-11  7:04               ` Nick Bowler
2018-12-11 12:27                 ` Brian Foster
2018-12-11 20:13                   ` Nick Bowler
2018-12-11 20:20                     ` Nick Bowler
2018-12-12 13:09                       ` Brian Foster
2018-12-13  0:21                         ` Nick Bowler
2018-12-12  4:56                   ` Nick Bowler
2018-12-13  3:53                     ` Dave Chinner
2018-12-13  4:14                       ` Nick Bowler
2018-12-13  4:49                         ` Nick Bowler
2018-12-13 21:39                           ` Dave Chinner
2018-12-13 21:53                             ` Nick Bowler
2018-12-14  1:43                               ` Dave Chinner
2018-12-14  3:35                             ` Nick Bowler
2018-12-14  3:40                               ` [RFC PATCH xfstests] xfs: add tests to validate ioctl structure layout Nick Bowler
2019-01-15 15:55                                 ` Luis Chamberlain
2018-12-13 16:30                       ` Darrick J. Wong [this message]

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=20181213163008.GC24487@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=bfoster@redhat.com \
    --cc=david@fromorbit.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=nbowler@draconx.ca \
    /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