summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_iomap.c
diff options
context:
space:
mode:
authorChandan Babu R <chandan.babu@oracle.com>2022-03-09 07:49:36 +0000
committerChandan Babu R <chandan.babu@oracle.com>2022-04-13 07:02:44 +0000
commit4f86bb4b66c999ad9ddcfd49fec93992eeba2715 (patch)
tree593c82f5b2a0f9f9bdd1c1dcd3fb34dbb5b8b661 /fs/xfs/xfs_iomap.c
parent83a21c18441f75aec64548692b52d34582b98a6a (diff)
downloadlinux-4f86bb4b66c999ad9ddcfd49fec93992eeba2715.tar.gz
linux-4f86bb4b66c999ad9ddcfd49fec93992eeba2715.tar.bz2
linux-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/xfs_iomap.c')
-rw-r--r--fs/xfs/xfs_iomap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 87e1cf5060bd..5a393259a3a3 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -251,6 +251,8 @@ xfs_iomap_write_direct(
return error;
error = xfs_iext_count_may_overflow(ip, XFS_DATA_FORK, nr_exts);
+ if (error == -EFBIG)
+ error = xfs_iext_count_upgrade(tp, ip, nr_exts);
if (error)
goto out_trans_cancel;
@@ -555,6 +557,9 @@ xfs_iomap_write_unwritten(
error = xfs_iext_count_may_overflow(ip, XFS_DATA_FORK,
XFS_IEXT_WRITE_UNWRITTEN_CNT);
+ if (error == -EFBIG)
+ error = xfs_iext_count_upgrade(tp, ip,
+ XFS_IEXT_WRITE_UNWRITTEN_CNT);
if (error)
goto error_on_bmapi_transaction;