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: sandeen@sandeen.net, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/2] xfs_io: fix broken funshare_cmd usage
Date: Tue, 6 Jul 2021 11:24:07 -0700	[thread overview]
Message-ID: <20210706182407.GB11588@locust> (raw)
In-Reply-To: <YOMiWq61o4GNlNAV@infradead.org>

On Mon, Jul 05, 2021 at 04:16:42PM +0100, Christoph Hellwig wrote:
> On Fri, Jul 02, 2021 at 07:58:02PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > Create a funshare_cmd and use that to store information about the
> > xfs_io funshare command instead of overwriting the contents of
> > fzero_cmd.  This fixes confusing output like:
> > 
> > $ xfs_io -c 'fzero 2 3 --help' /
> > fzero: invalid option -- '-'
> > funshare off len -- unshares shared blocks within the range
> 
> Ooops, how did this manage to ever work?

It "works" (in the sense that fzero and funshare issue the correct
fallocate modes) because add_command copies the contents of its struct
parameter into the internal command list.  The braindamage is limited to
any subsequent use of fzero_cmd, which (afaict) means the only way you'd
notice is through the help screens.

--D

> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>

  reply	other threads:[~2021-07-06 18:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-03  2:57 [PATCHSET 0/2] xfs_io: small fixes to funshare command Darrick J. Wong
2021-07-03  2:58 ` [PATCH 1/2] xfs_io: fix broken funshare_cmd usage Darrick J. Wong
2021-07-05 15:16   ` Christoph Hellwig
2021-07-06 18:24     ` Darrick J. Wong [this message]
2021-07-08  7:23   ` Carlos Maiolino
2021-07-03  2:58 ` [PATCH 2/2] xfs_io: clean up the funshare command a bit Darrick J. Wong
2021-07-05 15:20   ` Christoph Hellwig
2021-07-06 18:28     ` Darrick J. Wong
2021-07-08  7:31   ` Carlos Maiolino
  -- strict thread matches above, loose matches on Subject: below --
2021-07-28 21:15 [PATCHSET 0/2] xfs_io: small fixes to funshare command Darrick J. Wong
2021-07-28 21:16 ` [PATCH 1/2] xfs_io: fix broken funshare_cmd usage 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=20210706182407.GB11588@locust \
    --to=djwong@kernel.org \
    --cc=hch@infradead.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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