Bug 7696 - Quota lookup failed due to bad entries in mtab
Summary: Quota lookup failed due to bad entries in mtab
Status: RESOLVED WORKSFORME
Alias: None
Product: Samba 3.2
Classification: Unclassified
Component: File services (show other bugs)
Version: 3.2.7
Hardware: All Linux
: P3 normal
Target Milestone: ---
Assignee: Volker Lendecke
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-24 09:59 UTC by Tobias Mayer
Modified: 2012-09-06 09:51 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Mayer 2010-09-24 09:59:50 UTC
Due to a bug in SLES11 i discovered a problem where samba does not find the correct block device for a filesystem.

steps to reproduce:
modify your mtab file so that the entry for a bindmount comes before the mount of the actual FS. For example: (bind /home to /export/home before mounting /dev/sdb1 to /home)

/dev/mapper/system-root / ext3 rw,acl,user_xattr,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
debugfs /sys/kernel/debug debugfs rw 0 0
udev /dev tmpfs rw 0 0
devpts /dev/pts devpts rw,mode=0620,gid=5 0 0
/dev/sda2 /boot ext3 rw,acl,user_xattr 0 0
/dev/mapper/system2-opt /opt ext3 rw,acl,user_xattr 0 0
/dev/mapper/system2-usr /usr ext3 rw,acl,user_xattr 0 0
/dev/mapper/system2-var /var ext3 rw,acl,user_xattr 0 0
/home /export/home none rw,bind 0 0
fusectl /sys/fs/fuse/connections fusectl rw 0 0
securityfs /sys/kernel/security securityfs rw 0 0
nfsd /proc/fs/nfsd nfsd rw 0 0
rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0
/proc /var/lib/ntp/proc none ro,bind 0 0
/dev/sdb1 /home xfs rw,usrquota,grpquota 0 0

step 2:
start samba with a [homes] share.

result:
the function "sys_path_to_bdev" in sysquotas.c will assign the attributes of the bindmount to mountpoint, block device and FS.

The only problem i encountered so far was not reporting the quota size for the exported fs, but there could be more.
Comment 1 Björn Jacke 2012-09-06 09:51:30 UTC
also for bind mounts samba finds the right device via stat(). As you mentioned in the report this was a bug in SLES11 (?), so I'll close this here. If you think that samba does anything wrong, please reopen the bug. Thanks!