Merge branch 'for-linus' of git://neil.brown.name/md
[pandora-kernel.git] / fs / gfs2 / quota.c
index 3a9a974..7e528dc 100644 (file)
@@ -645,8 +645,11 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc,
        int err, nbytes;
        u64 size;
 
-       if (gfs2_is_stuffed(ip))
-               gfs2_unstuff_dinode(ip, NULL);
+       if (gfs2_is_stuffed(ip)) {
+               err = gfs2_unstuff_dinode(ip, NULL);
+               if (err)
+                       return err;
+       }
 
        memset(&q, 0, sizeof(struct gfs2_quota));
        err = gfs2_internal_read(ip, NULL, (char *)&q, &loc, sizeof(q));
@@ -813,7 +816,7 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda)
                goto out_alloc;
 
        if (nalloc)
-               blocks += gfs2_rg_blocks(al) + nalloc * ind_blocks + RES_STATFS;
+               blocks += gfs2_rg_blocks(ip) + nalloc * ind_blocks + RES_STATFS;
 
        error = gfs2_trans_begin(sdp, blocks, 0);
        if (error)
@@ -927,7 +930,9 @@ int gfs2_quota_lock(struct gfs2_inode *ip, u32 uid, u32 gid)
        unsigned int x;
        int error = 0;
 
-       gfs2_quota_hold(ip, uid, gid);
+       error = gfs2_quota_hold(ip, uid, gid);
+       if (error)
+               return error;
 
        if (capable(CAP_SYS_RESOURCE) ||
            sdp->sd_args.ar_quota != GFS2_QUOTA_ON)
@@ -1598,7 +1603,7 @@ static int gfs2_set_dqblk(struct super_block *sb, int type, qid_t id,
                error = gfs2_inplace_reserve(ip);
                if (error)
                        goto out_alloc;
-               blocks += gfs2_rg_blocks(al);
+               blocks += gfs2_rg_blocks(ip);
        }
 
        /* Some quotas span block boundaries and can update two blocks,