diff options
author | Chandan Babu R <chandan.babu@oracle.com> | 2022-03-09 07:49:36 +0000 |
---|---|---|
committer | Chandan Babu R <chandan.babu@oracle.com> | 2022-04-13 07:02:44 +0000 |
commit | 4f86bb4b66c999ad9ddcfd49fec93992eeba2715 (patch) | |
tree | 593c82f5b2a0f9f9bdd1c1dcd3fb34dbb5b8b661 /fs/xfs/libxfs/xfs_bmap.c | |
parent | 83a21c18441f75aec64548692b52d34582b98a6a (diff) | |
download | lwn-4f86bb4b66c999ad9ddcfd49fec93992eeba2715.tar.gz lwn-4f86bb4b66c999ad9ddcfd49fec93992eeba2715.zip |
xfs: Conditionally upgrade existing inodes to use large extent counters
This commit enables upgrading existing inodes to use large extent counters
provided that underlying filesystem's superblock has large extent counter
feature enabled.
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_bmap.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_bmap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 4fab0c92ab70..82d5467ddf2c 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -4524,14 +4524,16 @@ xfs_bmapi_convert_delalloc( return error; xfs_ilock(ip, XFS_ILOCK_EXCL); + xfs_trans_ijoin(tp, ip, 0); error = xfs_iext_count_may_overflow(ip, whichfork, XFS_IEXT_ADD_NOSPLIT_CNT); + if (error == -EFBIG) + error = xfs_iext_count_upgrade(tp, ip, + XFS_IEXT_ADD_NOSPLIT_CNT); if (error) goto out_trans_cancel; - xfs_trans_ijoin(tp, ip, 0); - if (!xfs_iext_lookup_extent(ip, ifp, offset_fsb, &bma.icur, &bma.got) || bma.got.br_startoff > offset_fsb) { /* |