diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2011-09-19 05:25:49 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2011-10-21 07:39:51 -0400 |
commit | 891a8e9335176b7eb9adc5e34f555ee5e1da47c6 (patch) | |
tree | 61e52cad86ab0455f310478189f21722a785c16d /fs/gfs2 | |
parent | 64dd153c83743af81f20924c6343652d731eeecb (diff) |
GFS2: Misc fixes
Some items picked up through automated code analysis. A few bits
of unreachable code and two unchecked return values.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/lops.c | 2 | ||||
-rw-r--r-- | fs/gfs2/ops_fstype.c | 3 | ||||
-rw-r--r-- | fs/gfs2/quota.c | 11 |
3 files changed, 8 insertions, 8 deletions
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index de05b4d66ef3..0301be655b12 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c | |||
@@ -695,8 +695,6 @@ static int databuf_lo_scan_elements(struct gfs2_jdesc *jd, unsigned int start, | |||
695 | 695 | ||
696 | brelse(bh_log); | 696 | brelse(bh_log); |
697 | brelse(bh_ip); | 697 | brelse(bh_ip); |
698 | if (error) | ||
699 | break; | ||
700 | 698 | ||
701 | sdp->sd_replayed_blocks++; | 699 | sdp->sd_replayed_blocks++; |
702 | } | 700 | } |
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 69166ff7f37d..7e823bbd2453 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c | |||
@@ -651,7 +651,6 @@ static int init_journal(struct gfs2_sbd *sdp, int undo) | |||
651 | fs_err(sdp, "can't lookup journal index: %d\n", error); | 651 | fs_err(sdp, "can't lookup journal index: %d\n", error); |
652 | return PTR_ERR(sdp->sd_jindex); | 652 | return PTR_ERR(sdp->sd_jindex); |
653 | } | 653 | } |
654 | ip = GFS2_I(sdp->sd_jindex); | ||
655 | 654 | ||
656 | /* Load in the journal index special file */ | 655 | /* Load in the journal index special file */ |
657 | 656 | ||
@@ -763,7 +762,6 @@ fail: | |||
763 | static int init_inodes(struct gfs2_sbd *sdp, int undo) | 762 | static int init_inodes(struct gfs2_sbd *sdp, int undo) |
764 | { | 763 | { |
765 | int error = 0; | 764 | int error = 0; |
766 | struct gfs2_inode *ip; | ||
767 | struct inode *master = sdp->sd_master_dir->d_inode; | 765 | struct inode *master = sdp->sd_master_dir->d_inode; |
768 | 766 | ||
769 | if (undo) | 767 | if (undo) |
@@ -788,7 +786,6 @@ static int init_inodes(struct gfs2_sbd *sdp, int undo) | |||
788 | fs_err(sdp, "can't get resource index inode: %d\n", error); | 786 | fs_err(sdp, "can't get resource index inode: %d\n", error); |
789 | goto fail_statfs; | 787 | goto fail_statfs; |
790 | } | 788 | } |
791 | ip = GFS2_I(sdp->sd_rindex); | ||
792 | sdp->sd_rindex_uptodate = 0; | 789 | sdp->sd_rindex_uptodate = 0; |
793 | 790 | ||
794 | /* Read in the quota inode */ | 791 | /* Read in the quota inode */ |
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 10a59cd21f0c..7e528dc14f85 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c | |||
@@ -645,8 +645,11 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, | |||
645 | int err, nbytes; | 645 | int err, nbytes; |
646 | u64 size; | 646 | u64 size; |
647 | 647 | ||
648 | if (gfs2_is_stuffed(ip)) | 648 | if (gfs2_is_stuffed(ip)) { |
649 | gfs2_unstuff_dinode(ip, NULL); | 649 | err = gfs2_unstuff_dinode(ip, NULL); |
650 | if (err) | ||
651 | return err; | ||
652 | } | ||
650 | 653 | ||
651 | memset(&q, 0, sizeof(struct gfs2_quota)); | 654 | memset(&q, 0, sizeof(struct gfs2_quota)); |
652 | err = gfs2_internal_read(ip, NULL, (char *)&q, &loc, sizeof(q)); | 655 | err = gfs2_internal_read(ip, NULL, (char *)&q, &loc, sizeof(q)); |
@@ -927,7 +930,9 @@ int gfs2_quota_lock(struct gfs2_inode *ip, u32 uid, u32 gid) | |||
927 | unsigned int x; | 930 | unsigned int x; |
928 | int error = 0; | 931 | int error = 0; |
929 | 932 | ||
930 | gfs2_quota_hold(ip, uid, gid); | 933 | error = gfs2_quota_hold(ip, uid, gid); |
934 | if (error) | ||
935 | return error; | ||
931 | 936 | ||
932 | if (capable(CAP_SYS_RESOURCE) || | 937 | if (capable(CAP_SYS_RESOURCE) || |
933 | sdp->sd_args.ar_quota != GFS2_QUOTA_ON) | 938 | sdp->sd_args.ar_quota != GFS2_QUOTA_ON) |