]> err.no Git - linux-2.6/blobdiff - fs/gfs2/bmap.c
ide/Kconfig: couple of fixes
[linux-2.6] / fs / gfs2 / bmap.c
index c1ee6355ced1e9f940129c1620947eaf4fa43fc5..c19184f2e70e53f268c757dd77d6a481b6f8604d 100644 (file)
@@ -900,15 +900,13 @@ static int do_grow(struct gfs2_inode *ip, u64 size)
        int error;
 
        al = gfs2_alloc_get(ip);
+       if (!al)
+               return -ENOMEM;
 
-       error = gfs2_quota_lock(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
+       error = gfs2_quota_lock_check(ip);
        if (error)
                goto out;
 
-       error = gfs2_quota_check(ip, ip->i_inode.i_uid, ip->i_inode.i_gid);
-       if (error)
-               goto out_gunlock_q;
-
        al->al_requested = sdp->sd_max_height + RES_DATA;
 
        error = gfs2_inplace_reserve(ip);
@@ -1081,7 +1079,8 @@ static int trunc_dealloc(struct gfs2_inode *ip, u64 size)
                lblock = (size - 1) >> sdp->sd_sb.sb_bsize_shift;
 
        find_metapath(sdp, lblock, &mp, ip->i_height);
-       gfs2_alloc_get(ip);
+       if (!gfs2_alloc_get(ip))
+               return -ENOMEM;
 
        error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
        if (error)