cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [GFS2 PATCH v2] gfs2: take jdata unstuff into account in do_grow
       [not found] <287553767.56662177.1545152379149.JavaMail.zimbra@redhat.com>
@ 2018-12-18 17:02 ` Bob Peterson
  0 siblings, 0 replies; only message in thread
From: Bob Peterson @ 2018-12-18 17:02 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

The previously posted patch works, but I decided it was better to add an
additional check for "unstuff" so it only requests the additional block
for the unstuffed jdata case where it's really needed.
---
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>
---
 fs/gfs2/bmap.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index 5292e10aaa80..02b2646d84b3 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -2084,6 +2084,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)



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-12-18 17:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <287553767.56662177.1545152379149.JavaMail.zimbra@redhat.com>
2018-12-18 17:02 ` [Cluster-devel] [GFS2 PATCH v2] gfs2: take jdata unstuff into account in do_grow Bob Peterson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).