This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch RHEL7
in repository gfs2-utils.
commit 2bf3a98449c55702e22129cab7766479167ef163
Author: Andrew Price <anprice(a)redhat.com>
Date: Fri Nov 11 13:24:34 2016 +0000
fsck.gfs2: Handle gfs2_readi() errors in check_statfs()
Discovered by static analysis with clang.
Related: rhbz#1394235
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/fsck/main.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/gfs2/fsck/main.c b/gfs2/fsck/main.c
index c5967bc..51f3e03 100644
--- a/gfs2/fsck/main.c
+++ b/gfs2/fsck/main.c
@@ -170,9 +170,12 @@ static int check_statfs(struct gfs2_sbd *sdp)
/* Read the current statfs values */
count = gfs2_readi(sdp->md.statfs, buf, 0,
sdp->md.statfs->i_di.di_size);
- if (count == sizeof(struct gfs2_statfs_change))
- gfs2_statfs_change_in(&sc, buf);
-
+ if (count != sizeof(struct gfs2_statfs_change)) {
+ log_err(_("Failed to read statfs values (%d of %"PRIu64"
read)\n"),
+ count, (uint64_t)sdp->md.statfs->i_di.di_size);
+ return FSCK_ERROR;
+ }
+ gfs2_statfs_change_in(&sc, buf);
/* Calculate the real values from the rgrp information */
sdp->blks_total = 0;
sdp->blks_alloced = 0;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date