[PATCH] xfs: bmap shouldn't barf on inline-format directories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When we're fulfilling a BMAPX request, check that the fork is still in
extents or btree format just prior to calling bmapi.  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.

To reproduce, run "xfs_io -c 'bmap -e'" on any inline directory.

Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
---
 fs/xfs/xfs_bmap_util.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index 7ac80a1..378f142 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -614,6 +614,11 @@ xfs_getbmap(
 		return -EINVAL;
 	bmvend = bmv->bmv_offset + bmv->bmv_length;
 
+	/* Local format inodes don't have any extents to report. */
+	if (ip->i_d.di_format == XFS_DINODE_FMT_LOCAL) {
+		bmv->bmv_entries = 0;
+		return 0;
+	}
 
 	if (bmv->bmv_count > ULONG_MAX / sizeof(struct getbmapx))
 		return -ENOMEM;
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux