From: Bob Peterson Date: Wed, 30 May 2018 15:18:30 -0400 (EDT) Subject: [Cluster-devel] [GFS2 PATCH] gfs2: revert af21ca8ed50f01c5278c5ded6dad6f05e8a5d2e4 In-Reply-To: <673438191.38585914.1527707876350.JavaMail.zimbra@redhat.com> Message-ID: <1047004353.38586049.1527707910671.JavaMail.zimbra@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, Patch af21ca8ed5 is defective and needs to be reverted. The idea was to only reserve single blocks for directories, with the thought that they should be packed together. That's all well and good for creating new directories, but directories have other reasons for getting reservations: for example, when files are added to them and they need their directory hash tables expanded. For those purposes, one block may not be enough and the reservation can run out of blocks, forcing us to do block allocations without a reservation. We can also get into situations where we cannot modify a directory when we should be able to. This patch reverts the patch. Signed-off-by: Bob Peterson --- fs/gfs2/rgrp.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 8be47b81011a..d7a8ed8bb30c 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -1529,14 +1529,9 @@ static void rg_mblk_search(struct gfs2_rgrpd *rgd, struct gfs2_inode *ip, u32 extlen; u32 free_blocks = rgd_free(rgd, rs); int ret; - struct inode *inode = &ip->i_inode; - if (S_ISDIR(inode->i_mode)) - extlen = 1; - else { - extlen = max_t(u32, atomic_read(&rs->rs_sizehint), ap->target); - extlen = clamp(extlen, RGRP_RSRV_MINBLKS, free_blocks); - } + extlen = max_t(u32, atomic_read(&rs->rs_sizehint), ap->target); + extlen = clamp(extlen, RGRP_RSRV_MINBLKS, free_blocks); if ((rgd->rd_free_clone < rgd->rd_reserved) || (free_blocks < extlen)) return;