Skip to contentSkip to conversation

gfs2: take jdata unstuff into account in do_grow

PATCH Superseded Bob Peterson 2 participants 2 messages Dec 18, 2018 1 message not in the archive GFS2 file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 gfs2: take jdata unstuff into account in do_grow

In reply to a message not in the archive

Hi,

Before this patch, function do_grow would not reserve enough journal blocks in the transaction to unstuff jdata files while growing them. This patch adds the logic to add one more block if the file to grow is jdata.

---
 fs/gfs2/bmap.c | 1 +
 1 file changed, 1 insertion(+)
fs/gfs2/bmap.c +1 -0
index 5292e10aaa80..8df98e8bd8c8 100644
@@ -2084,6 +2084,7 @@ static int do_grow(struct inode *inode, u64 size)
 	}
 
 	error = gfs2_trans_begin(sdp, RES_DINODE + RES_STATFS + RES_RG_BIT +
+				 (gfs2_is_jdata(ip) ? RES_JDATA : 0) +
 				 (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF ?
 				  0 : RES_QUOTA), 0);
 	if (error)
#2 lore raw

PATCH 1/1 gfs2: take jdata unstuff into account in do_grow

Quoted 8 lines · Bob Peterson

Hi,

Before this patch, function do_grow would not reserve enough journal blocks in the transaction to unstuff jdata files while growing them. This patch adds the logic to add one more block if the file to grow is jdata.

Quoted 9 lines
---
 fs/gfs2/bmap.c | 1 +
 1 file changed, 1 insertion(+)
fs/gfs2/bmap.c +0 -0
index 5292e10aaa80..8df98e8bd8c8 100644

fs/gfs2/bmap.c static int do_grow(struct inode *inode, u64 size) · line 2090

Quoted 7 lines
fs/gfs2/bmap.c +1 -0
@@ -2084,6 +2084,7 @@ static int do_grow(struct inode *inode, u64 size)
        }
 
        error = gfs2_trans_begin(sdp, RES_DINODE + RES_STATFS + RES_RG_BIT +
+                                (gfs2_is_jdata(ip) ? RES_JDATA : 0) +
                                 (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF ?
                                  0 : RES_QUOTA), 0);
        if (error)

Thanks,
Andreas