--- linux-2.6.19/fs/quota.c~ 2007-03-01 19:45:40.694648408 +0100 +++ linux-2.6.19/fs/quota.c 2007-03-02 00:27:24.196276620 +0100 @@ -415,34 +415,6 @@ return 0; } -/* - * look up a superblock on which quota ops will be performed - * - use the name of a block device to find the superblock thereon - */ -static inline struct super_block *quotactl_block(const char __user *special) -{ -#ifdef CONFIG_BLOCK - struct block_device *bdev; - struct super_block *sb; - char *tmp = getname(special); - - if (IS_ERR(tmp)) - return ERR_PTR(PTR_ERR(tmp)); - bdev = lookup_bdev(tmp); - putname(tmp); - if (IS_ERR(bdev)) - return ERR_PTR(PTR_ERR(bdev)); - sb = get_super(bdev); - bdput(bdev); - if (!sb) - return ERR_PTR(-ENODEV); - - return sb; -#else - return ERR_PTR(-ENODEV); -#endif -} - #if defined(CONFIG_BLK_DEV_VROOT) || defined(CONFIG_BLK_DEV_VROOT_MODULE) #include @@ -481,6 +453,50 @@ #endif /* + * look up a superblock on which quota ops will be performed + * - use the name of a block device to find the superblock thereon + */ +static inline struct super_block *quotactl_block(const char __user *special) +{ +#ifdef CONFIG_BLOCK + struct block_device *bdev; + struct super_block *sb; + char *tmp = getname(special); + + if (IS_ERR(tmp)) + return ERR_PTR(PTR_ERR(tmp)); + bdev = lookup_bdev(tmp); + putname(tmp); + if (IS_ERR(bdev)) + return ERR_PTR(PTR_ERR(bdev)); +#if defined(CONFIG_BLK_DEV_VROOT) || defined(CONFIG_BLK_DEV_VROOT_MODULE) + if (bdev && bdev->bd_inode && + imajor(bdev->bd_inode) == VROOT_MAJOR) { + struct block_device *bdnew = (void *)-EINVAL; + + if (vroot_get_real_bdev) + bdnew = vroot_get_real_bdev(bdev); + else + vxdprintk(VXD_CBIT(misc, 0), + "vroot_get_real_bdev not set"); + bdput(bdev); + if (IS_ERR(bdnew)) + return ERR_PTR(PTR_ERR(bdnew)); + bdev = bdnew; + } +#endif + sb = get_super(bdev); + bdput(bdev); + if (!sb) + return ERR_PTR(-ENODEV); + + return sb; +#else + return ERR_PTR(-ENODEV); +#endif +} + +/* * This is the system call interface. This communicates with * the user-level programs. Currently this only supports diskquota * calls. Maybe we need to add the process quotas etc. in the future,