From: Bob Peterson Date: Fri, 23 Mar 2018 16:43:14 -0400 (EDT) Subject: [Cluster-devel] [PATCH] gfs2: Check for the end of metadata in punch_hole In-Reply-To: <20180323182918.17501-1-agruenba@redhat.com> References: <20180323182918.17501-1-agruenba@redhat.com> Message-ID: <614642872.13200022.1521837794691.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 ----- Original Message ----- | When punching a hole or truncating an inode down to a given size, also | check if the truncate point / start of the hole is within the range we | have metadata for. Otherwise, we can end up freeing blocks that | shouldn't be freed, corrupting the inode, or crashing the machine when | trying to punch a hole into the void. | | When growing an inode via truncate, we set the new size but we don't | allocate additional levels of indirect blocks and grow the inode height. | When shrinking that inode again, the new size may still point beyond the | end of the inode's metadata. | | Fixes xfstest generic/476. | | Debugged-by: Bob Peterson | Signed-off-by: Andreas Gruenbacher | --- Hi, Thanks. This is now pushed to the for-next branch of the linux-gfs2 tree: https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git/commit/fs/gfs2?h=for-next&id=bb491ce67aa7c1635e5ae4f2f304a7d13d3dbe71 Regards, Bob Peterson Red Hat File Systems