xfs: remote attribute lookups require the value length
[firefly-linux-kernel-4.4.55.git] / fs / xfs / xfs_attr_leaf.c
index 8eeb88fb3201a516a9394e2d8621168d9c62948c..0bce1b3485800a9319fb1116a5d8d11edf485392 100644 (file)
@@ -2332,9 +2332,10 @@ xfs_attr3_leaf_lookup_int(
                        if (!xfs_attr_namesp_match(args->flags, entry->flags))
                                continue;
                        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,
-                                                  be32_to_cpu(name_rmt->valuelen));
+                                                      args->valuelen);
                        return XFS_ERROR(EEXIST);
                }
        }