Description of problem: lsattr is not showing attributes of files, or at least for the /aquota.* files. Other files were not tested. SELinux is off. # lsattr /aquota.* ------------- /aquota.group ------------- /aquota.user # chmod 644 /aquota.* chmod: changing permissions of `/aquota.group': Operation not permitted chmod: changing permissions of `/aquota.user': Operation not permitted # chattr -i /aquota.* # lsattr /aquota.* ------------- /aquota.group ------------- /aquota.user # chmod 644 /aquota.* that works. Version-Release number of selected component (if applicable): e2fsprogs-1.39-10.el5_1.1 How reproducible: All the time. Steps to Reproduce: 1. Make sure SELinux is off. 2. In /etc/fstab make sure to have: /dev/myvg/rootvol / ext3 defaults,usrquota,grpquota 0 0 i.e. usrquota,grpquota in the mount options and then reboot. 3. quotacheck -cugm / 4. reboot 5. setquota -g somegroup 0 maxQuotaInKB 0 0 / 6. chmod 644 /aquota.* (returns permission denied on both files) 7. lsattr /aquota.* (showed no bits set) 8. chattr -i /aquota.* (did something) 9. lsattr /aquota.* (showed no bits set, which is ok) 10. chmod 644 /aquota.* (works this time around). Actual results: lsattr doesn't show attributes of files Expected results: lsattr should show attributes of files Additional info:
FWIW, an upstream change prevents changing the flags on these files: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=e47776a0a41a14a5634633c96e590827f552c4b5 /* Is it quota file? Do not allow user to mess with it */ if (IS_NOQUOTA(inode)) { mutex_unlock(&inode->i_mutex); return -EPERM; } The file does indeed have S_IMMUTABLE set (looking at it in the debugger) - I'll see why it's not reported by lsattr.
This actually looks like a kernel issue; it's not a huge priority but yes, it should be fixed.
Hm, took another look at this and upstream it's like this: [root@inode mnt]# lsattr /mnt/scratch/aquota.user -------------e- /mnt/scratch/aquota.user [root@inode mnt]# chattr +i /mnt/scratch/aquota.* [root@inode mnt]# lsattr /mnt/scratch/aquota.user ----i--------e- /mnt/scratch/aquota.user so it seems to be working there.
This was fixed upstream with the following commits: 28be5abb400e5e082f5225105fdc69337ec0c0b4 4f99ed67cc1cf5302ea18aa042d75641b61a0a1b ff9ddf7e847c4dc533f119efb6c77a6e57ab6397 The inode flags in struct ext3_inode_info were going out of sync with the inode flags in struct inode. The above commits fix it for ext[2-4]. Here's the log message of the first one: commit 28be5abb400e5e082f5225105fdc69337ec0c0b4 Author: Jan Kara <jack> Date: Tue May 8 00:30:33 2007 -0700 ext3: copy i_flags to inode flags on write A patch that stores inode flags such as S_IMMUTABLE, S_APPEND, etc. from i_flags to EXT3_I(inode)->i_flags when inode is written to disk. The same thing is done on GETFLAGS ioctl. Quota code changes these flags on quota files (to make it harder for sysadmin to screw himself) and these changes were not correctly propagated into the filesystem (especially, lsattr did not show them and users were wondering...). Propagate flags such as S_APPEND, S_IMMUTABLE, etc. from i_flags into ext3-specific i_flags. Hence, when someone sets these flags via a different interface than ioctl, they are stored correctly. Signed-off-by: Jan Kara <jack> Cc: <linux-ext4.org> Signed-off-by: Andrew Morton <akpm> Signed-off-by: Linus Torvalds <torvalds>
Ah, thanks for the reminder, I'd forgotten that went by. -Eric
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release.
Patch(es) available in kernel-2.6.18-255.el5 You can download this test kernel (or newer) from http://people.redhat.com/jwilson/el5 Detailed testing feedback is always welcomed.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2011-1065.html