Re: [PATCH 06/22][RFC] Unionfs: Dentry operations

From: Jan Engelhardt
Date: Mon Sep 04 2006 - 03:05:25 EST



>+/*
>+ * THIS IS A BOOLEAN FUNCTION: returns 1 if valid, 0 otherwise.
>+ */

Candiate for "generic boolean patch"!

>+ if (!restart && (pdgen != sbgen)) {
()

>+ } else if (dbstart(dentry) < 0) {
>+ /* this is due to a failed lookup */
>+ /* the failed lookup has a dtohd_ptr set to null,
>+ but this is a better check */
>+ printk(KERN_DEBUG "dentry without hidden dentries : %*s",
>+ dentry->d_name.len, dentry->d_name.name);

I think you want %.*s

>+out_free:
>+ /* No need to unlock it, because it is disappeared. */
>+ free_dentry_private_data(dtopd(dentry));
>+ dtopd_lhs(dentry) = NULL; /* just to be safe */

Things like this NULLing could be removed. It if then oopses somewhere,
you either

(a) needed this =NULL indeed (because some other function depends
on it being NULL)

or (b) found a bug elsewhere (more likely, since you write "just to be safe")


The (a) case is needed if you wanted to kfree(dtopd_lhs(dentry))
elsewhere it.


Jan Engelhardt
--

--
VGER BF report: H 0.00065657
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/