All of lore.kernel.org
 help / color / mirror / Atom feed
* tmpfs readdir does not update dir access time
@ 2004-01-11 21:17 Mark Borgerding
  2004-01-12 19:28 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Borgerding @ 2004-01-11 21:17 UTC (permalink / raw)
  To: linux-fsdevel

I just submitted a bug and proposed a patch to fs/libfs.c (function == 
dcache_readdir ).
http://bugme.osdl.org/show_bug.cgi?id=1837

I wanted to say something on the fs-devel list to find out if any 
filesystems depend on dcache_readdir NOT updating the access time ( 
calling update_atime ) during a readdir.  This seems like its broken to 
me. But I'm just a caveman who fell through some ice and was later 
thawed by your scientists -- your world frightens and confuses me.

The danger is that this patch could break a fs that relies on the 
existing (wrong?) behavior provided by dcache_readdir ( a.k.a 
simple_dir_operations->readdir ), which never updates the atime of a dir 
inode.

Note that this change will not affect inodes for which IS_NOATIME or 
IS_NODIRATIME is true.  Those will get  ignored by the function 
update_atime.  e.g If the fs was mounted 'noatime', or the S_NOATIME bit 
is set in i_flags.

I did a quick check in the 2.6.1 kernel tree to see what may be using 
the dcache_readdir. Here's a list of possible candidiates:

$> find ./ -type f -name '*.c' |xargs grep -n -e simple_fill_super -e 
simple_dir_operations -e dcache_readdir

./net/sunrpc/rpc_pipe.c:422:                    inode->i_fop = 
&simple_dir_operations;
./drivers/isdn/capi/capifs.c:131:       inode->i_fop = 
&simple_dir_operations;
./drivers/usb/core/inode.c:174:                 inode->i_fop = 
&simple_dir_operations;
./drivers/usb/gadget/inode.c:1800:                      0, 
&simple_dir_operations,
./drivers/oprofile/oprofilefs.c:266:    inode->i_fop = 
&simple_dir_operations;
./drivers/oprofile/oprofilefs.c:286:    root_inode->i_fop = 
&simple_dir_operations;
./arch/ia64/sn/io/hwgfs/ramfs.c:82:                     inode->i_fop = 
&simple_dir_operations;
./fs/nfsd/nfsctl.c:414: return simple_fill_super(sb, 0x6e667364, 
nfsd_files);
./fs/sysfs/dir.c:16:    inode->i_fop = &simple_dir_operations;
./fs/sysfs/mount.c:39:          inode->i_fop = &simple_dir_operations;
./fs/autofs4/root.c:34: .readdir        = dcache_readdir,
./fs/autofs4/inode.c:314:               inode->i_fop = 
&simple_dir_operations;
./fs/autofs/inode.c:212:        inode->i_fop = &simple_dir_operations;
./fs/devpts/inode.c:96: inode->i_fop = &simple_dir_operations;
./fs/hugetlbfs/inode.c:396:                     inode->i_fop = 
&simple_dir_operations;
./fs/ramfs/inode.c:74:                  inode->i_fop = 
&simple_dir_operations;
./fs/binfmt_misc.c:617: int err = simple_fill_super(sb, 0x42494e4d, 
bm_files);
./security/selinux/selinuxfs.c:615:     return simple_fill_super(sb, 
SELINUX_MAGIC, selinux_files);

(I've omitted the hits from fs/fslib.c & mm/shmem.c since that was the 
intended effect. )


Regards,
    Mark Borgerding


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

* Re: tmpfs readdir does not update dir access time
  2004-01-11 21:17 tmpfs readdir does not update dir access time Mark Borgerding
@ 2004-01-12 19:28 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2004-01-12 19:28 UTC (permalink / raw)
  To: Mark Borgerding; +Cc: linux-fsdevel

On Sun, Jan 11, 2004 at 04:17:51PM -0500, Mark Borgerding wrote:
> ./drivers/usb/core/inode.c:174:     inode->i_fop = &simple_dir_operations;
> ./drivers/usb/gadget/inode.c:1800:  0, &simple_dir_operations,

> ./fs/sysfs/dir.c:16:    inode->i_fop = &simple_dir_operations;
> ./fs/sysfs/mount.c:39:          inode->i_fop = &simple_dir_operations;

It's ok for these three filesystems.

thanks,

greg k-h

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

end of thread, other threads:[~2004-01-12 19:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-11 21:17 tmpfs readdir does not update dir access time Mark Borgerding
2004-01-12 19:28 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.