From: Bob Peterson Date: Tue, 18 Dec 2018 14:29:32 +0000 (-0600) Subject: gfs2: take jdata unstuff into account in do_grow X-Git-Tag: v4.19.88~176 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7baf8fd1ffff8e57f903956c10d8a18dc098cdbe;p=thirdparty%2Fkernel%2Fstable.git gfs2: take jdata unstuff into account in do_grow [ Upstream commit bc0205612bbd4dd4026d4ba6287f5643c37366ec ] 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. Signed-off-by: Bob Peterson Reviewed-by: Andreas Gruenbacher Signed-off-by: Sasha Levin --- diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 52feccedd7a44..096b479721395 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -2122,6 +2122,8 @@ static int do_grow(struct inode *inode, u64 size) } error = gfs2_trans_begin(sdp, RES_DINODE + RES_STATFS + RES_RG_BIT + + (unstuff && + gfs2_is_jdata(ip) ? RES_JDATA : 0) + (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF ? 0 : RES_QUOTA), 0); if (error)