Re: [PATCH v2] d_ino considered harmful

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Valerie Aurora
Date: Thursday, June 17, 2010 - 11:58 am

On Fri, Jun 18, 2010 at 03:04:08AM +0900, J. R. Okajima wrote:

What I'm hearing again and again is that d_ino is useful to improve
performance.  As Andreas put it to me, if d_ino is the same, the
referenced file may or may not be the same, but if it's different, the
files are definitely different.  Only in well-controlled environments
known not to have submounts or bind mounts do people trust d_ino to be
from the same file system as the other entries in a directory.

I only submitted this patch half-seriously - mainly I wanted to find
out how people are using d_ino, and therefore what I need to do for
fallthru directory entries in union mounts.

In order to get the correct inode number for a directory entry
referring to a lower layer file or directory, we have to do a
->lookup() from the fs-specific readdir code (or else require that
fallthrus store an arbitrarily sized integer - which seriously
restricts the implementation).  Now, doing a ->lookup() to get d_ino
makes no sense if we are using d_ino as a way to avoid the cost
stat(), which is mainly the ->lookup().  And you definitely can't use
d_ino by itself in a union mount.

I'm inclined to save the trouble and just return 1 in d_ino for
fallthru directory entries, especially now that I've tested it
system-wide and had no obvious problems.

-VAL
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] d_ino considered harmful, Valerie Aurora, (Wed Jun 16, 11:59 am)
Re: [PATCH] d_ino considered harmful, Arnd Bergmann, (Wed Jun 16, 12:10 pm)
Re: [PATCH] d_ino considered harmful, Jeff Layton, (Wed Jun 16, 12:15 pm)
Re: [PATCH v2] d_ino considered harmful, Valerie Aurora, (Wed Jun 16, 12:54 pm)
Re: [PATCH] d_ino considered harmful, Valerie Aurora, (Wed Jun 16, 12:58 pm)
Re: [PATCH] d_ino considered harmful, Valerie Aurora, (Wed Jun 16, 12:58 pm)
Re: [PATCH v2] d_ino considered harmful, David Dillow, (Wed Jun 16, 1:44 pm)
Re: [PATCH v2] d_ino considered harmful, Jamie Lokier, (Thu Jun 17, 10:54 am)
Re: [PATCH v2] d_ino considered harmful, David Dillow, (Thu Jun 17, 11:17 am)
Re: [PATCH v2] d_ino considered harmful, Valerie Aurora, (Thu Jun 17, 11:58 am)
Re: [PATCH v2] d_ino considered harmful, Valerie Aurora, (Thu Jun 17, 12:10 pm)
Re: [PATCH v2] d_ino considered harmful, Andreas Dilger, (Thu Jun 17, 4:39 pm)
Re: [PATCH v2] d_ino considered harmful, Andreas Dilger, (Thu Jun 17, 6:41 pm)
Re: [PATCH v2] d_ino considered harmful, J. R. Okajima, (Thu Jun 17, 7:57 pm)
Re: [PATCH v2] d_ino considered harmful, Valerie Aurora, (Fri Jun 18, 12:41 pm)