summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2018-12-18 17:29:32 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-05 17:26:52 +0300
commit84c5f3d78a3eac25847472a6f4c0e27a2e8a8d5a (patch)
tree07bc0e112e71762df6596c460709f1836a484d5d /fs
parent957d7c195962adffeb7beb043a4b8ce6afb5c2b4 (diff)
downloadlinux-84c5f3d78a3eac25847472a6f4c0e27a2e8a8d5a.tar.xz
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 <rpeterso@redhat.com> Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/bmap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index 09476bb8f6cd..f0302e09eff9 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -1235,6 +1235,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)