xfs
[Top] [All Lists]

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

To: xfs@xxxxxxxxxxx
Subject: [PATCH] xfsprogs: fix cut & paste error in xfs_fsr.c
From: Eric Sandeen <sandeen@xxxxxxxxxx>
Date: Tue, 10 Nov 2015 12:21:10 -0600
Cc: jtulak@xxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
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>
---

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 ||


<Prev in Thread] Current Thread [Next in Thread>