From: Chiaki Subject: [Fwd: Re: Configuration system bug? : tmpfs listing in /proc/filesystems when TMPFS was not configured!?] Date: Sun, 07 Nov 2004 11:23:10 +0900 Message-ID: <418D870E.7030706@yk.rim.or.jp> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000202000105000501040401" Cc: ishikawa@yk.rim.or.jp Return-path: Received: from serio.al.rim.or.jp ([202.247.191.123]:48828 "EHLO serio.al.rim.or.jp") by vger.kernel.org with ESMTP id S261516AbUKGCXP (ORCPT ); Sat, 6 Nov 2004 21:23:15 -0500 To: linux-fsdevel@vger.kernel.org Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org This is a multi-part message in MIME format. --------------000202000105000501040401 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit (Posted a problem to linux-kernel when TMPFS is not configured and yet /proc/filesystems lists tmpfs. After searching I think this mailing list might have a better chance of addressing of my bug(?) report. Please cc: me since I am not subscribed to linux-fsdevel. -- int main(void){int j=2003;/*(c)2003 cishikawa. */ char t[] =" @abcdefghijklmnopqrstuvwxyz.,\n\""; char *i ="g>qtCIuqivb,gCwe\np@.ietCIuqi\"tqkvv is>dnamz"; while(*i)((j+=strchr(t,*i++)-(int)t),(j%=sizeof t-1), (putchar(t[j])));return 0;}/* under GPL */ --------------000202000105000501040401 Content-Type: message/rfc822; name="Re: Configuration system bug? : tmpfs listing in /proc/filesystems when TMPFSwas not configured!?" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Re: Configuration system bug? : tmpfs listing in /proc/filesystems when TMPFSwas not configured!?" Received: from serio.al.rim.or.jp (serio [202.247.191.123]) by mx2.rim.or.jp (8.12.11/8.12.11) with ESMTP id iA72C3eW027115 for ; Sun, 7 Nov 2004 11:12:03 +0900 (JST) Received: from mail5 by serio.al.rim.or.jp (3.7W/HMX-13) id LAA16283; Sun, 7 Nov 2004 11:12:01 +0900 (JST) Received: from [192.168.1.4] (121.64.150.220.ap.yournet.ne.jp [220.150.64.121]) by mail5 (8.9.3/3.7W) id LAA24167; Sun, 7 Nov 2004 11:12:00 +0900 (JST) Message-ID: <418D8470.9070907@yk.rim.or.jp> Date: Sun, 07 Nov 2004 11:12:00 +0900 From: Chiaki User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913 X-Accept-Language: ja, en-us, en MIME-Version: 1.0 To: linux-kernel@vger.kernel.org CC: Chiaki Subject: Re: Configuration system bug? : tmpfs listing in /proc/filesystems when TMPFS was not configured!? References: <418D0EFB.2040002@yk.rim.or.jp> <418D7AF4.5090500@yk.rim.or.jp> In-Reply-To: <418D7AF4.5090500@yk.rim.or.jp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hello, (Now I am bcc:ing to Hugh Dickins hugh at veritas.com since his name was in filesystems/tmpfs.txt documentation file.) I noticed that /proc/filesystems lists "tmpfs" although I have not configured TMPFS during the kernel compilation. I have somehow figured out where tmpfs is registered although I have not configured it in .config. (Kernel 2.6.9) Please note that in mm/shmem.c, all the normal file operations are ifdef'ed out when CONFI_TMPFS is not set. (See shmem_dir_inode_operations initial value below.) So file creation, etc. won't be supported. However(!), regsiter_filesystem(&tmpfs_fs_type) line Line 2057 in mm/shmem.c: in init_tmpfs() is NOT ifdef'ed out. Should not this line be ifdef'ed out??? That is, should we modify the line like this? #ifdef CONFIG_TMPFS error = register_filesystem(&tmpfs_fs_type); #endif Chiaki cf. Here is the explanation for kernel mount operation we find in init_tmpfs(). From /usr/src/linux/Documentation/filesystems/tmpfs.txt >tmpfs has the following uses: > >1) There is always a kernel internal mount which you will not see at > all. This is used for shared anonymous mappings and SYSV shared > memory. > > This mount does not depend on CONFIG_TMPFS. If CONFIG_TMPFS is not > set, the user visible part of tmpfs is not build. But the internal > mechanisms are always present. I agree user visible part of tmpfs is not build when CONFIG_TMPFS is not set, and thus tmpfs should not be registered. Trying to use tmpfs (by creating files/directories) will fail when CONFIG_TMPFS is not set. Thus useless and so /proc/filesystems should not show tmpfs IMHO. (Or not registering it interferes with the internal kernel mount operation? [like not being able to find tmpfs function for internal kernel mount operaton mentioned above??? We probably need to unregister it in that case immediately after the internal mount succeeded. Maybe.] ] References: From mm/shmem.c: static struct inode_operations shmem_dir_inode_operations = { #ifdef CONFIG_TMPFS .create = shmem_create, .lookup = simple_lookup, .link = shmem_link, .unlink = shmem_unlink, .symlink = shmem_symlink, .mkdir = shmem_mkdir, .rmdir = shmem_rmdir, .mknod = shmem_mknod, .rename = shmem_rename, #endif }; static struct super_operations shmem_ops = { .alloc_inode = shmem_alloc_inode, .destroy_inode = shmem_destroy_inode, #ifdef CONFIG_TMPFS .statfs = shmem_statfs, .remount_fs = shmem_remount_fs, #endif .delete_inode = shmem_delete_inode, .drop_inode = generic_delete_inode, .put_super = shmem_put_super, }; Then later in init_tmpfs(): static int __init init_tmpfs(void) { int error; error = init_inodecache(); if (error) goto out3; error = register_filesystem(&tmpfs_fs_type); if (error) { printk(KERN_ERR "Could not register tmpfs\n"); goto out2; } #ifdef CONFIG_TMPFS devfs_mk_dir("shm"); #endif shm_mnt = do_kern_mount(tmpfs_fs_type.name, MS_NOUSER, tmpfs_fs_type.name, NULL); I think the above register_filesystem() ought to be ifdef'ed out. -- int main(void){int j=2003;/*(c)2003 cishikawa. */ char t[] =" @abcdefghijklmnopqrstuvwxyz.,\n\""; char *i ="g>qtCIuqivb,gCwe\np@.ietCIuqi\"tqkvv is>dnamz"; while(*i)((j+=strchr(t,*i++)-(int)t),(j%=sizeof t-1), (putchar(t[j])));return 0;}/* under GPL */ --------------000202000105000501040401--