]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: always free inline data before resetting inode fork during ifree
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 22 Nov 2017 20:21:07 +0000 (12:21 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 27 Nov 2017 17:33:25 +0000 (09:33 -0800)
commitaab14fcc27aee6ee770759b7e2cc2fa48e0e7ee0
tree111e7c14e1d57dd1c7828fb760f08b5886a4daed
parentfc34a8d7a6e80eb2c2304f3fb1526e012599ae42
xfs: always free inline data before resetting inode fork during ifree

In xfs_ifree, we reset the data/attr forks to extents format without
bothering to free any inline data buffer that might still be around
after all the blocks have been truncated off the file.  Prior to commit
515ccfbdb2 ("xfs: remove support for inlining data/extents into the
inode fork") nobody noticed because the leftover inline data after
truncation was small enough to fit inside the inline buffer inside the
fork itself.

However, now that we've removed the inline buffer, we /always/ have to
free the inline data buffer or else we leak them like crazy.  This test
was found by turning on kmemleak for generic/001 or generic/388.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_inode.c