From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Borgerding Subject: tmpfs readdir does not update dir access time Date: Sun, 11 Jan 2004 16:17:51 -0500 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <4001BD7F.5090301@borgerding.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from ms-smtp-02-smtplb.ohiordc.rr.com ([65.24.5.136]:19117 "EHLO ms-smtp-02-eri0.ohiordc.rr.com") by vger.kernel.org with ESMTP id S265993AbUAKVR7 (ORCPT ); Sun, 11 Jan 2004 16:17:59 -0500 Received: from borgerding.net (cvg-65-27-241-239.cinci.rr.com [65.27.241.239]) by ms-smtp-02-eri0.ohiordc.rr.com (8.12.10/8.12.7) with SMTP id i0BLHuaZ001476 for ; Sun, 11 Jan 2004 16:17:57 -0500 (EST) To: linux-fsdevel@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 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