Re: [PATCH 1/2] xfs_io: fix broken funshare_cmd usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> > 
> > 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@xxxxxx>



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux