public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfsprogs: fix cut & paste error in xfs_fsr.c
@ 2015-11-10 18:21 Eric Sandeen
  2015-11-10 18:45 ` Eric Sandeen
  2015-11-10 20:28 ` Dave Chinner
  0 siblings, 2 replies; 7+ messages in thread
From: Eric Sandeen @ 2015-11-10 18:21 UTC (permalink / raw)
  To: xfs; +Cc: jtulak

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@redhat.com>
---

I'll probably follow this with some other cleanups, but this is
the functional fix AFAICT.

diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
index b902acc..9332c57 100644
--- a/fsr/xfs_fsr.c
+++ b/fsr/xfs_fsr.c
@@ -433,12 +433,11 @@ initallfs(char *mtab)
 	}
 
 	while ( (mp = platform_mntent_next(&cursor)) != NULL) {
+		int rw = 0;
+
 		mntp = find_mountpoint_check(&sb, mp, &ms);
 		if (mntp == NULL)
 			continue;
-		break;
-
-		int rw = 0;
 
 		if (strcmp(mp->mnt_type, MNTTYPE_XFS ) != 0 ||
 		    stat64(mp->mnt_fsname, &sb) == -1 ||


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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-11-11 15:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-10 18:21 [PATCH] xfsprogs: fix cut & paste error in xfs_fsr.c Eric Sandeen
2015-11-10 18:45 ` Eric Sandeen
2015-11-10 20:28 ` Dave Chinner
2015-11-10 20:35   ` Eric Sandeen
2015-11-11 13:13     ` Jan Tulak
2015-11-11 15:41       ` Eric Sandeen
2015-11-10 20:45   ` [PATCH] xfsprogs: tidy up xfs_fsr.c Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox