浏览代码

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 <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Darrick J. Wong 8 年之前
父节点
当前提交
6eadbf4c8b
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      fs/xfs/xfs_bmap_util.c

+ 6 - 2
fs/xfs/xfs_bmap_util.c

@@ -582,9 +582,13 @@ xfs_getbmap(
 		}
 		}
 		break;
 		break;
 	default:
 	default:
+		/* Local format data forks report no extents. */
+		if (ip->i_d.di_format == XFS_DINODE_FMT_LOCAL) {
+			bmv->bmv_entries = 0;
+			return 0;
+		}
 		if (ip->i_d.di_format != XFS_DINODE_FMT_EXTENTS &&
 		if (ip->i_d.di_format != XFS_DINODE_FMT_EXTENTS &&
-		    ip->i_d.di_format != XFS_DINODE_FMT_BTREE &&
-		    ip->i_d.di_format != XFS_DINODE_FMT_LOCAL)
+		    ip->i_d.di_format != XFS_DINODE_FMT_BTREE)
 			return -EINVAL;
 			return -EINVAL;
 
 
 		if (xfs_get_extsz_hint(ip) ||
 		if (xfs_get_extsz_hint(ip) ||