From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Mon, 30 Jul 2018 16:12:21 -0400 (EDT) Subject: [Cluster-devel] [PATCH 3/3] gfs2: Don't create unnecessary indirect blocks In-Reply-To: <20180730123353.15815-3-agruenba@redhat.com> References: <20180730123353.15815-1-agruenba@redhat.com> <20180730123353.15815-3-agruenba@redhat.com> Message-ID: <392189053.55813751.1532981541334.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, ----- Original Message ----- > When gfs2 increases the height of an inode, it always creates an > indirect block for each the new level of indirection, even when the > inode is entirely empty. For example, these commands: > > $ mkfs.gfs2 -O -b 4096 -p lock_nolock /dev/vdb > $ mount /dev/vdb /mnt/test/ > $ xfs_io -f -c 'truncate 0' -c 'pwrite 509b 4k' /mnt/test/foo > > will create a pointer to an entirely empty indirect block. This is > unnecessary, so fix the code to avoid that. While at it, clean things > up and add some more documentation. > > Signed-off-by: Andreas Gruenbacher > --- (snip) > + bool overlap = false; Can we change overlap to be unsigned or something? Although technically there's nothing wrong with doing so, arithmetic with a bool just rubs me the wrong way. (snip) > + i = 1 + overlap; This patch is a little more cryptic. I'll have to look at it again when I'm fresh. Regards, Bob Peterson