Re: [PATCH] xfsprogs: fix cut & paste error in xfs_fsr.c

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

 



On 11/10/15 12:21 PM, Eric Sandeen wrote:
> Commit:
> 
> 7141fc xfsprogs: make fsr use mntinfo when there is no mntent
> 
> added an inadvertent "break;" to initallfs() after the call
> to find_mountpoint_check(); this is likely a cut & paste error
> from the call in find_mountpoint(), where we really *do* want to
> stop after the first one we find.
> 
> Fix that by removing the break, and fix the declaration-after-code.
> 
> Addresses-Coverity-Id: 1338431
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
> ---

Actually, unless Jan's commit fixes something important for this
release (and I don't think it does?) I'd just revert it; it's
pretty chock full of outright errors and other weirdness.

For example:

initallfs(mtab);
   struct stat64 sb;
   mntp = find_mountpoint_check(&sb, mp, &ms);

and find_mounpoint_check() does:

     if (S_ISDIR(sb->st_mode)) {

so "sb" is never initialized on that path.  Weird that Coverity
didn't see it.

(I'm also not a fan of using "sb" and "mp" for things that aren't
superblocks and xfs_mount_t's, but that's just style I guess...)

((and every caller passes an ms stat buffer into the function,
which can be local to the function, as no caller uses it ...))

(((and there's whitespace damage)))

Jan said this patch "fell under the sofa" - I think it might need a
bit more dusting off before it's ready to go... ;)

-Eric

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs



[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux