Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 1220829 Details for
Bug 1394235
gfs2-utils: Fixes for static analysis warnings
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh92 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
RHEL6 version of the upstream patch
bz1394235-fsck_gfs2_Handle_gfs2_readi_errors_in_check_statfs.patch (text/plain), 2.40 KB, created by
Andrew Price
on 2016-11-15 12:59:08 UTC
(
hide
)
Description:
RHEL6 version of the upstream patch
Filename:
MIME Type:
Creator:
Andrew Price
Created:
2016-11-15 12:59:08 UTC
Size:
2.40 KB
patch
obsolete
>commit 46f911bc2828e8783550aeba065a23281b3d04c4 >Author: Andrew Price <anprice@redhat.com> >Date: Tue Nov 15 05:55:02 2016 -0600 > > fsck.gfs2: Handle gfs2_readi() errors in check_statfs() > > Discovered by static analysis with clang. > > Resolves: rhbz#1394235 > Signed-off-by: Andrew Price <anprice@redhat.com> > >diff --git a/gfs2/fsck/main.c b/gfs2/fsck/main.c >index 85e6775..d456195 100644 >--- a/gfs2/fsck/main.c >+++ b/gfs2/fsck/main.c >@@ -150,25 +150,28 @@ static void interrupt(int sig) > } > } > >-static void check_statfs(struct gfs2_sbd *sdp) >+static int check_statfs(struct gfs2_sbd *sdp) > { > struct osi_node *n, *next = NULL; > struct rgrp_tree *rgd; > struct gfs2_rindex *ri; >- struct gfs2_statfs_change sc; >+ struct gfs2_statfs_change sc = {0}; > char buf[sizeof(struct gfs2_statfs_change)]; > int count; > > if (sdp->gfs1 && !sdp->md.statfs->i_di.di_size) { > log_info("This GFS1 file system is not using fast_statfs.\n"); >- return; >+ return 0; > } > /* 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; >@@ -188,7 +191,7 @@ static void check_statfs(struct gfs2_sbd *sdp) > sc.sc_free == (sdp->blks_total - sdp->blks_alloced) && > sc.sc_dinodes == sdp->dinodes_alloced) { > log_info( _("The statfs file is accurate.\n")); >- return; >+ return 0; > } > log_err( _("The statfs file is wrong:\n\n")); > log_err( _("Current statfs values:\n")); >@@ -216,12 +219,13 @@ static void check_statfs(struct gfs2_sbd *sdp) > errors_found++; > if (!query( _("Okay to fix the master statfs file? (y/n)"))) { > log_err( _("The statfs file was not fixed.\n")); >- return; >+ return 0; > } > > do_init_statfs(sdp); > log_err( _("The statfs file was fixed.\n")); > errors_corrected++; >+ return 0; > } > > static void exitlog(int status, void *unused) >@@ -382,7 +386,7 @@ int main(int argc, char **argv) > } > > if (!fsck_abort) >- check_statfs(sdp); >+ error = check_statfs(sdp); > > /* Free up our system inodes */ > if (!sdp->gfs1)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1394235
: 1220829