From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Steve French (IBM LTC)" Subject: Re: quota woes Date: Wed, 13 Aug 2003 10:50:32 -0500 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <3F3A5E48.8670D4CE@us.ibm.com> References: <3F36A2EC.EC77B3FF@us.ibm.com> <20030812122320.GA31282@atrey.karlin.mff.cuni.cz> <20030812230532.GB743@frodo> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from e5.ny.us.ibm.com ([32.97.182.105]:15750 "EHLO e5.ny.us.ibm.com") by vger.kernel.org with ESMTP id S275265AbTHMP4x (ORCPT ); Wed, 13 Aug 2003 11:56:53 -0400 To: Nathan Scott , linux-fsdevel@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org sys_quotactl takes a pathname, which is translated to a superblock. This would work fine for the many "deviceless" filesystems except that the name is not translated as it is in most path based calls in the kernel. sys_quotactl takes the path name (ie parm named special) and simply converts it to a superblock: tmp = getname(special); if (IS_ERR(tmp)) return PTR_ERR(tmp); bdev = lookup_bdev(tmp); putname(tmp); if (IS_ERR(bdev)) return PTR_ERR(bdev); sb = get_super(bdev); My suggestion is to allow this to work for more filesystems by falling back on failure on the above device to sb resolution (or changing the above code) to the standard way paths are resolved to superblocks in the kernel sys layer. For example in statfs the name to superblock resolution is done simply by calling: error = user_path_walk(path, &nd); then the vfs routine is called with the sb retrieved from above: vfs_statfs_native(nd.dentry->d_inode->i_sb ...) This kind of name resolution (using user_path_walk or equivalent) handles a much wider variety of filesystems than doing the more awkward name to device then device to superblock. Note that the routine that dispatches to the filesystem only needs a superblock (which deviceless and network filesystems can handle) and does not explicitly need a device number or name: do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, caddr_t addr) I expect that CIFS and AFS and NFSv4 are not the only deviceless filesystems that could be easily enhanced to transparently send the quota calls to the proper target server if the above change were made. For the CIFS case, sending user quota calls to the server (Samba, Windows, Network Attached Storage appliance) is fairly easy (group quotas for the case of CIFS network protocol need more investigation). Nathan Scott wrote: > > And currently they are > > validating the device because kernel interface requires a device (at > > least if we are speaking about standard VFS quota - XFS is a bit > > different case). > > The XFS commands all require block special devices; the one command > that doesn't is Q_SYNC (one of the standard VFS commands) because > it can be used to sync all filesystems quota files at once, iirc. > > cheers. > > -- > Nathan