From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: ROOT_DEV usage in hostfs Date: Tue, 25 Jan 2005 10:10:39 +0100 Message-ID: <20050125091039.GA32409@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from verein.lst.de ([213.95.11.210]:35228 "EHLO mail.lst.de") by vger.kernel.org with ESMTP id S261729AbVAYJLB (ORCPT ); Tue, 25 Jan 2005 04:11:01 -0500 To: jdike@karaya.com, pasky@ucw.cz Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Could someone explain why hosts does thnings like: if((ino->i_sb->s_dev == ROOT_DEV) && (ino->i_uid == getuid())) ino->i_uid = 0; (in fs/hostfs/hostfs_kern.c:read_name()) and if(attr->ia_valid & ATTR_UID){ if((dentry->d_inode->i_sb->s_dev == ROOT_DEV) && (attr->ia_uid == 0)) attr->ia_uid = getuid(); attrs.ia_valid |= HOSTFS_ATTR_UID; attrs.ia_uid = attr->ia_uid; } if(attr->ia_valid & ATTR_GID){ if((dentry->d_inode->i_sb->s_dev == ROOT_DEV) && (attr->ia_gid == 0)) attr->ia_gid = getuid(); attrs.ia_valid |= HOSTFS_ATTR_GID; attrs.ia_gid = attr->ia_gid; } (hostfs_getattr) A filesystems shouldn't have special casing for the rootfs, and chowning files from root to the current user sounds like an extremly bad idea to me aswell. It's also the last thing preventing us from exporting ROOT_DEV