Re: [PATCH 1/2] vfs: sanitize __d_path()

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

 



Alexey Dobriyan wrote:
> Why would they want to do it (which means taking locks again and
> potential incoherence)?
> The information is right there, ship it upwards:
> 
> +       if (deleted)
> +               *deleted = 0;
>         spin_lock(&vfsmount_lock);
>         prepend(&end, &buflen, "\0", 1);
> -       if (d_unlinked(dentry) &&
> -               (prepend(&end, &buflen, " (deleted)", 10) != 0))
> -                       goto Elong;
> +       if (d_unlinked(dentry) && deleted)
> +               *deleted = 1;
> 
> "(deleted)" as interface sucks, we can't change it,
> at least, let's make in-kernel interface correct.

We don't need vfsmount_lock for d_unlinked(), do we?
Then, I think we can do

+	if (deleted)
+		*deleted = d_unlinked(dentry);
 	spin_lock(&vfsmount_lock);
-	prepend(&end, &buflen, "\0", 1);
+	prepend(&end, &buflen, "", 1);
-	if (d_unlinked(dentry) &&
-	    (prepend(&end, &buflen, " (deleted)", 10) != 0))
-		goto Elong;
--
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