Skip to content

Commit 6eadbf4

Browse files
committed
xfs: BMAPX shouldn't barf on inline-format directories
When we're fulfilling a BMAPX request, jump out early if the data fork is in local format. This prevents us from hitting a debugging check in bmapi_read and barfing errors back to userspace. The on-disk extent count check later isn't sufficient for IF_DELALLOC mode because da extents are in memory and not on disk. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Brian Foster <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent 0daaeca commit 6eadbf4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

fs/xfs/xfs_bmap_util.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,9 +582,13 @@ xfs_getbmap(
582582
}
583583
break;
584584
default:
585+
/* Local format data forks report no extents. */
586+
if (ip->i_d.di_format == XFS_DINODE_FMT_LOCAL) {
587+
bmv->bmv_entries = 0;
588+
return 0;
589+
}
585590
if (ip->i_d.di_format != XFS_DINODE_FMT_EXTENTS &&
586-
ip->i_d.di_format != XFS_DINODE_FMT_BTREE &&
587-
ip->i_d.di_format != XFS_DINODE_FMT_LOCAL)
591+
ip->i_d.di_format != XFS_DINODE_FMT_BTREE)
588592
return -EINVAL;
589593

590594
if (xfs_get_extsz_hint(ip) ||

0 commit comments

Comments
 (0)