Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 48746

Summary: Permission denied while trying to view quota on XFS volume as a non-root user with Linux 2.6.5-mm6.
Product: Gentoo Linux Reporter: Ed Plese <ed>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED TEST-REQUEST    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Ed Plese 2004-04-22 17:48:58 UTC
With quota-3.06-r2 installed, upon running 'quota' as a non-root user, the following error occurs:

$ quota
quota: Can't stat() mounted device /dev/vg/home: Permission denied
Disk quotas for user ed (uid 1000): none

The volume is XFS with ACLs and quotas enabled running on an LVM2 volume.

uname -a:
Linux morpheus 2.6.5-mm6 #3 SMP Thu Apr 22 13:06:15 CDT 2004 i686 Intel(R) Xeon(TM) CPU 2.80GHz GenuineIntel GNU/Linux

After further investigation, any call to quotactl(QCMD(Q_XGETQUOTA, USRQUOTA), ... , uid, ...) fails with an EACCES error when called as a non-root user, even when the uid is the same as the user trying to execute this function.


On a different setup with 'uname -a':

Linux orion 2.4.24-pre1-xfs #3 SMP Sun Jan 18 13:24:23 CST 2004 i686 Intel(R) Pentium(R) 4 CPU 2.60GHz GenuineIntel GNU/Linux

the 'quota' command works perfectly.  This system that works is also running XFS with ACL and quota support, with the XFS volume residing on a LVM1 volume.


Reproducible: Always
Steps to Reproduce:
1.  Setup a Gentoo system from the latest 2004.0 LiveCD using the Pentium 4 stage 3 package.
2.  Install sys-kernel/mm-sources (linux-2.6.5-mm6).  Configure the kernel with devicemapper, XFS, XFS ACLs, XFS quotas, and quota support.
3.  Install sys-apps/quota (3.06-r2).
4.  Create an XFS partition on an LVM2 volume and mount it with usrquota,grpquota options.
5.  Setup quotas for a non-root user with 'edquota -u username'.
6.  Create some files on that partition as that user.
7.  Run 'quota' as that user.  Any other program that calls the quotactl() function will fail also.

Actual Results:  
$ quota
quota: Can't stat() mounted device /dev/vg/home: Permission denied
Disk quotas for user ed (uid 1000): none


Expected Results:  
Running 'quota' as a non-root user should have given output like:

Disk quotas for user ed (uid 1000): 
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
/dev/vg/home
                  32004   50000   50000            2015       0       0        


# emerge info
Portage 2.0.50-r6 (default-x86-2004.0, gcc-3.3.2, glibc-2.3.2-r9, 2.6.5-mm6)
=================================================================
System uname: 2.6.5-mm6 i686 Intel(R) Xeon(TM) CPU 2.80GHz
Gentoo Base System version 1.4.3.13
Autoconf: sys-devel/autoconf-2.58
Automake: sys-devel/automake-1.7.7
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -march=pentium4 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="http://gentoo.chem.wisc.edu/gentoo/"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl apm arts avi berkdb crypt cups encode foomaticdb gdbm gif gnome gpm
gtk gtk2 imlib jpeg kde ldap libg++ libwww mad mikmod mmx motif mpeg ncurses nls
oggvorbis opengl oss pam pdflib perl png python qt quicktime readline sdl slang
spell sse ssl svga tcpd truetype x86 xml2 xmms xv zlib"
Comment 1 Ed Plese 2004-04-23 11:13:33 UTC
After performing some additional testing, it appears that this bug occurs only when the XFS filesystem resides on a logical volume created with LVM.

On the same system as described above that did not work,

as root:

$ mkdir /mnt/test
$ chmod 777 /mnt/test
$ dd if=/dev/zero of=/root/xfstest bs=1M count=128
$ losetup /dev/loop0 /root/xfstest
$ mkfs.xfs /dev/loop0
$ mount -t xfs -o usrquota,grpquota /dev/loop0 /mnt/test
$ quotaon /mnt/test
$ edquota -f /mnt/test ed

as ed:  

$ quota
quota: Can't stat() mounted device /dev/vg_data/home: Permission denied
Disk quotas for user ed (uid 1000):
     Filesystem  blocks   quota   limit   grace   files   quota   limit
     grace
          /dev/loop0       0    1000    2000               1       0       0


So, on that same system, with two XFS filesystems mounted with quotas enabled, one residing on an LVM2 volume and the other residing on a loopback device, as shown above, the loopback device properly returns the user quotas, whereas the LVM device does not.
Comment 2 SpanKY gentoo-dev 2004-10-09 17:46:29 UTC
can you try with latest versions of quota/kernel ?
Comment 3 SpanKY gentoo-dev 2004-11-29 18:34:30 UTC
test 3.12 please