浏览代码

xfs: remote attribute lookups require the value length

When reading a remote attribute, to correctly calculate the length
of the data buffer for CRC enable filesystems, we need to know the
length of the attribute data. We get this information when we look
up the attribute, but we don't store it in the args structure along
with the other remote attr information we get from the lookup. Add
this information to the args structure so we can use it
appropriately.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>

(cherry picked from commit e461fcb194172b3f709e0b478d2ac1bdac7ab9a3)
Dave Chinner 12 年之前
父节点
当前提交
7ae077802c
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      fs/xfs/xfs_attr_leaf.c

+ 2 - 1
fs/xfs/xfs_attr_leaf.c

@@ -2332,9 +2332,10 @@ xfs_attr3_leaf_lookup_int(
 			if (!xfs_attr_namesp_match(args->flags, entry->flags))
 			if (!xfs_attr_namesp_match(args->flags, entry->flags))
 				continue;
 				continue;
 			args->index = probe;
 			args->index = probe;
+			args->valuelen = be32_to_cpu(name_rmt->valuelen);
 			args->rmtblkno = be32_to_cpu(name_rmt->valueblk);
 			args->rmtblkno = be32_to_cpu(name_rmt->valueblk);
 			args->rmtblkcnt = XFS_B_TO_FSB(args->dp->i_mount,
 			args->rmtblkcnt = XFS_B_TO_FSB(args->dp->i_mount,
-						   be32_to_cpu(name_rmt->valuelen));
+						       args->valuelen);
 			return XFS_ERROR(EEXIST);
 			return XFS_ERROR(EEXIST);
 		}
 		}
 	}
 	}