linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] d_ino considered harmful
@ 2010-06-16 18:59 Valerie Aurora
  2010-06-16 19:10 ` Arnd Bergmann
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Valerie Aurora @ 2010-06-16 18:59 UTC (permalink / raw)
  To: Alexander Viro, Christoph Hellwig, Miklos Szeredi, Jan Blunck,
	Jamie Lokier
  Cc: linux-kernel, linux-fsdevel

Who needs d_ino anyway?  I am running a kernel with this patch -
Gnome, a browser, IRC, kernel compile, etc. and everything works.

-VAL

commit 184f3919d0071f3bfa40010aa6919ea89999d79b
Author: Valerie Aurora <vaurora@redhat.com>
Date:   Wed Jun 16 11:05:06 2010 -0700

    VFS: Always return 0 for d_ino
    
    Use of d_ino without the corresponding st_dev is always buggy in the
    presence of submounts, bind mounts, and union mounts.  E.g., the d_ino
    of a mountpoint will be the inode number of the directory under the
    mountpoint, not the mounted directory.  Correct code must call stat(),
    which returns the correct device ID and inode in st_dev and st_ino.
    Since no one should be using d_ino anyway, always return 0 to detect
    bugs.

diff --git a/fs/readdir.c b/fs/readdir.c
index dd3eae1..38ea772 100644
--- a/fs/readdir.c
+++ b/fs/readdir.c
@@ -91,7 +91,9 @@ static int fillonedir(void * __buf, const char * name, int namlen, loff_t offset
 
 	if (buf->result)
 		return -EINVAL;
-	d_ino = ino;
+	/* Use of d_ino without st_dev is always buggy. */
+	d_ino = 0;
+
 	if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) {
 		buf->result = -EOVERFLOW;
 		return -EOVERFLOW;

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2010-06-18 19:41 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-16 18:59 [PATCH] d_ino considered harmful Valerie Aurora
2010-06-16 19:10 ` Arnd Bergmann
2010-06-16 19:58   ` Valerie Aurora
2010-06-16 19:15 ` Jeff Layton
2010-06-16 19:58   ` Valerie Aurora
2010-06-16 19:54 ` [PATCH v2] " Valerie Aurora
2010-06-16 20:44   ` David Dillow
2010-06-17 18:04     ` J. R. Okajima
2010-06-17 18:17       ` David Dillow
2010-06-17 18:58       ` Valerie Aurora
2010-06-18  1:41       ` Andreas Dilger
2010-06-18  2:57         ` J. R. Okajima
2010-06-17 17:54   ` Jamie Lokier
2010-06-17 19:10     ` Valerie Aurora
2010-06-17 23:39   ` Andreas Dilger
2010-06-18 19:41     ` Valerie Aurora

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).