[Top] [All Lists]

[PATCH 04/12] xfs: remote attribute lookups require the value length

To: xfs@xxxxxxxxxxx
Subject: [PATCH 04/12] xfs: remote attribute lookups require the value length
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Fri, 7 Jun 2013 22:24:53 +1000
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1370607901-11538-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1370564771-4929-1-git-send-email-david@xxxxxxxxxxxxx> <1370607901-11538-1-git-send-email-david@xxxxxxxxxxxxx>
From: Dave Chinner <dchinner@xxxxxxxxxx>

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

Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
 libxfs/xfs_attr_leaf.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libxfs/xfs_attr_leaf.c b/libxfs/xfs_attr_leaf.c
index 881f417..d9f5ec5 100644
--- a/libxfs/xfs_attr_leaf.c
+++ b/libxfs/xfs_attr_leaf.c
@@ -2122,9 +2122,10 @@ xfs_attr3_leaf_lookup_int(
                        if (!xfs_attr_namesp_match(args->flags, entry->flags))
                        args->index = probe;
+                       args->valuelen = be32_to_cpu(name_rmt->valuelen);
                        args->rmtblkno = be32_to_cpu(name_rmt->valueblk);
                        args->rmtblkcnt = XFS_B_TO_FSB(args->dp->i_mount,
+                                                      args->valuelen);
                        return XFS_ERROR(EEXIST);

<Prev in Thread] Current Thread [Next in Thread>