Re: [RFC][PATCH 6/14] Union-mount dentry reference counting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On May 14 2007 15:11, Bharata B Rao wrote:
>+void __union_check(struct dentry *dentry)
>+{
>+	if (likely(!(dentry->d_topmost || dentry->d_overlaid))) {

This could be simplified to

   if (likely(!dentry->d_topmost && !dentry->d_overlaid))

(I prefer x==NULL over !x for pointers, though)
And then again, do not assume everything is (un)likely [also elsewhere].

>+		if (unlikely(dentry->d_union)) {
>+			printk(KERN_ERR "%s: \"%s\" stale union reference\n" \
>+			       "\tdentry=%p, inode=%p, count=%d, u_count=%d\n",
>+			       __FUNCTION__,
>+			       dentry->d_name.name,
>+			       dentry,
>+			       dentry->d_inode,
>+			       atomic_read(&dentry->d_count),
>+			       atomic_read(&dentry->d_union->u_count));
>+			dump_stack();
>+		}
>+		return;
>+	}
>+
>--- a/net/unix/af_unix.c
>+++ b/net/unix/af_unix.c
>@@ -1082,8 +1082,11 @@ restart:
> 		newu->addr = otheru->addr;
> 	}
> 	if (otheru->dentry) {
>-		newu->dentry	= dget(otheru->dentry);
>+		/* Is this safe here? I don't know ... */

Figure it out :)


	Jan
-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux