[GFS2] Force unstuff of hidden quota inode
authorAbhijith Das <adas@redhat.com>
Tue, 14 Aug 2007 20:34:58 +0000 (15:34 -0500)
committerSteven Whitehouse <swhiteho@redhat.com>
Wed, 10 Oct 2007 07:55:22 +0000 (08:55 +0100)
This patch forcibly unstuffs (if stuffed) the hidden quota inode at the
first availble opportunity. In any practical scenario the quota inode
won't be stuffed, so this is ok to do. Unstuffing the quota inode allows
us to ignore the case of a stuffed quota inode in gfs2_adjust_quota().

Signed-off-by: Abhijith Das <adas@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/quota.c

index 6e546ee8f3d4d237e01f44aac67db0a35dc0f296..5dfa4656122b13e257593bb3709df99841b0f1f1 100644 (file)
@@ -614,6 +614,16 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc,
        s64 value;
        int err = -EIO;
 
+       if (gfs2_is_stuffed(ip)) {
+               struct gfs2_alloc *al = NULL;
+               al = gfs2_alloc_get(ip);
+               /* just request 1 blk */
+               al->al_requested = 1;
+               gfs2_inplace_reserve(ip);
+               gfs2_unstuff_dinode(ip, NULL);
+               gfs2_inplace_release(ip);
+               gfs2_alloc_put(ip);
+       }
        page = grab_cache_page(mapping, index);
        if (!page)
                return -ENOMEM;