]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
gfs2: take jdata unstuff into account in do_grow
authorBob Peterson <rpeterso@redhat.com>
Tue, 18 Dec 2018 14:29:32 +0000 (08:29 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 08:20:36 +0000 (09:20 +0100)
[ 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 <rpeterso@redhat.com>
Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/gfs2/bmap.c

index 52feccedd7a441a0a423789f73ebd997f7a023a0..096b4797213953cf32f5fc339068d2486cf399c2 100644 (file)
@@ -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)