* [PATCH v3, 08/16] xfsprogs: metadump: ensure dup table always has entry for obfuscated name
@ 2011-02-18 21:21 Alex Elder
2011-02-24 1:49 ` Dave Chinner
0 siblings, 1 reply; 2+ messages in thread
From: Alex Elder @ 2011-02-18 21:21 UTC (permalink / raw)
To: xfs
We need to ensure the nametable has a copy of all the names in a
directory (or attribute fork) in order to avoid creating duplicate
entries when obfuscating names. Currently there is an (unlikely)
case where the name is passed back without such an entry being
created. Reorder things so that won't happen.
Signed-off-by: Alex Elder <aelder@sgi.com>
No significant changes in this version from the last one posted.
---
db/metadump.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
Index: b/db/metadump.c
===================================================================
--- a/db/metadump.c
+++ b/db/metadump.c
@@ -540,18 +540,22 @@ generate_obfuscated_name(
}
} while (dup);
- memcpy(name, newname, namelen);
+ /* Create an entry for the name in the name table */
p = malloc(sizeof(name_ent_t) + namelen);
if (p == NULL)
return;
- p->next = nametable[hash % NAME_TABLE_SIZE];
- p->hash = hash;
p->namelen = namelen;
- memcpy(p->name, name, namelen);
+ memcpy(p->name, newname, namelen);
+ p->hash = hash;
+ p->next = nametable[hash % NAME_TABLE_SIZE];
nametable[hash % NAME_TABLE_SIZE] = p;
+
+ /* Update the caller's copy with the obfuscated name */
+
+ memcpy(name, newname, namelen);
}
static void
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v3, 08/16] xfsprogs: metadump: ensure dup table always has entry for obfuscated name
2011-02-18 21:21 [PATCH v3, 08/16] xfsprogs: metadump: ensure dup table always has entry for obfuscated name Alex Elder
@ 2011-02-24 1:49 ` Dave Chinner
0 siblings, 0 replies; 2+ messages in thread
From: Dave Chinner @ 2011-02-24 1:49 UTC (permalink / raw)
To: Alex Elder; +Cc: xfs
On Fri, Feb 18, 2011 at 03:21:01PM -0600, Alex Elder wrote:
> We need to ensure the nametable has a copy of all the names in a
> directory (or attribute fork) in order to avoid creating duplicate
> entries when obfuscating names. Currently there is an (unlikely)
> case where the name is passed back without such an entry being
> created. Reorder things so that won't happen.
>
> Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-24 1:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-18 21:21 [PATCH v3, 08/16] xfsprogs: metadump: ensure dup table always has entry for obfuscated name Alex Elder
2011-02-24 1:49 ` Dave Chinner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox