]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: Check for extent overflow when removing dir entries
authorChandan Babu R <chandanrlinux@gmail.com>
Sat, 23 Jan 2021 00:48:12 +0000 (16:48 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Sat, 23 Jan 2021 00:54:47 +0000 (16:54 -0800)
commit2a6d55ad39a7dc57da069510c67cf633fed6d313
tree1d24f1f8b30ef9837581398895873495d01d643f
parent8ceb6e51cfac1e18064e8950794426cc4d411aeb
xfs: Check for extent overflow when removing dir entries

Directory entry removal must always succeed; Hence XFS does the
following during low disk space scenario:
1. Data/Free blocks linger until a future remove operation.
2. Dabtree blocks would be swapped with the last block in the leaf space
   and then the new last block will be unmapped.

This facility is reused during low inode extent count scenario i.e. this
commit causes xfs_bmap_del_extent_real() to return -ENOSPC error code so
that the above mentioned behaviour is exercised causing no change to the
directory's extent count.

Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/libxfs/xfs_bmap.c