VxFS quota not working on Solaris
gdoucet at csc.com
gdoucet at csc.com
Wed Jan 16 08:02:03 GMT 2002
Thanks for the response.
I run Veritas VxFS 3.3.3 on Solaris 7 with Samba 2.2.2.
I put an other Debug (line 527) to see what is the : DEBUG(5,
("disk_quotas: mount option: %s\n", mnt.mnt_mntopts));
Has you can see, no option "dev=". mnt_mntopts is rw,log,suid,quota.
Processing section "[quota]"
doing parameter comment = Quota Test
doing parameter path = /export/vxfs_quota_test/doucetg
Connect path is /export/vxfs_quota_test/doucetg
claiming quota 0
get_share_security: using default secdesc for quota
vfs_ChDir to /export/vxfs_quota_test/doucetg
doucetg-1 (47.115.37.31) connect to service quota as user doucetg
(uid=50180, gid=4033) (pid 5520)
tconX service=quota user=doucetg
vfs_ChDir to /export/vxfs_quota_test/doucetg
call_trans2qfsinfo : SMB_QUERY_FS_VOLUME_INFO namelen = 5, vol = quota
[2002/01/16 10:22:56, 5]
../samba-2.2.2/source/smbd/quotas.c:disk_quotas(512)
disk_quotas: looking for path "." devno=249e463
[2002/01/16 10:22:56, 5]
../samba-2.2.2/source/smbd/quotas.c:disk_quotas(527)
disk_quotas: mount option: rw,log,suid,quota
[2002/01/16 10:22:56, 5]
../samba-2.2.2/source/smbd/quotas.c:disk_quotas(528)
disk_quotas: testing "/export/vxfs_quota_test" dev=249e463
[2002/01/16 10:22:56, 5]
../samba-2.2.2/source/smbd/quotas.c:disk_quotas(577)
disk_quotas: looking for quotas file "/export/vxfs_quota_test/quotas"
[2002/01/16 10:22:56, 5]
../samba-2.2.2/source/smbd/quotas.c:disk_quotas(595)
disk_quotas ioctl (Solaris) failed. Error = Inappropriate ioctl for
device
[2002/01/16 10:22:56, 5]
../samba-2.2.2/source/smbd/quotas.c:disk_quotas(600)
disk_quotas: mount type "vxfs"
[2002/01/16 10:22:56, 5]
../samba-2.2.2/source/smbd/quotas.c:disk_quotas_vxfs(1018)
disk_quotas: looking for VxFS quotas file
"/export/vxfs_quota_test/quotas"
[2002/01/16 10:22:56, 5]
../samba-2.2.2/source/smbd/quotas.c:disk_quotas_vxfs(1052)
disk_quotas for path "." block c/s/h 1200/0/0; file c/s/h 4/0/0
I figure it out.. I try to do an ioctl like it is a UFS filesystem, if not
succed it try with the VxFS ioctl, and then is able to return the quota.
see line 598 (/* If normal quotactl() fails, try vxfs private calls */).
I saw in the TODO (http://us1.samba.org/samba/TODO.html) they want to
rewrite quota as a VFS module. VFS module maybe not a good think, but
something similar. Like having a struct with the filesystem type and a
callback . Check the filesystem type (vxfs, ufs, nfs.. etc.) and then call
the apopriate callback.
For my problem I will send a bug repport with the change in
include/include.h and smbd/qoutas.c
Thanks for your help.
- -
Geoffroy Doucet
David Lee
<t.d.lee at durh To: Geoffroy Doucet/GIS/CSC at CSC
am.ac.uk> cc: samba-technical at lists.samba.org, Shirish Kalele <kalele at veritas.com>
Subject: Re: VxFS quota not working on Solaris
01/15/02
05:21 PM
On Tue, 15 Jan 2002 gdoucet at csc.com wrote:
> I try to use quota on a VxFS filesystem and Solaris 7 and does not work.
Oh my! A blast from the past!
I suspect the number of sites running Solaris/VXFS/quotas can be counted
on the fingers of one hand.
The Solaris/VxFS code was originally sketched well over two years ago for
our system: Solaris 2.6 with a version of VXFS (3.2.4?) that had its own,
hidden, way of getting quotas: see routine "disk_quotas_vxfs(...)".
If memory serves me aright, the configure script would attempt to find one
of Veritas include files, and eventually, after some indirection, would
ensure that "VXFS_QUOTA" ended up being defined automatically.
I can confirm that that worked on Solaris 2.6 (32-bit on a ultra 450) and
whatever version of VxFS was current at the time.
In writing this, Shirish Kalele at Veritas gave, on an informal basis,
some very useful help and advice. One of his modifications turned out to
be exceedingly useful to us.
A year ago we upgraded to Solaris 8 (skipping Solaris 7) and VxFS 3.4 . I
got very worried when I discovered that this version of VxFS did not have
the include files. But magically, the quotas still worked, and I think
this might be because this version of VxFS support the Solaris way
"ioctl(...)" of getting quotas, making the earlier code unnecessary.
(That's where Shirish's tweak was valuable: he ensured that the Solaris
scheme was always called first, and only if it failed would it then fall
back to "disk_quotas_vxfs()".)
Alas, I don't really know who can offer much support on Solaris/VxFS.
Veritas? No. My understanding is that they didn't support it. But I
wonder whether that has changed since, because I understand that about a
year ago Veritas now actually began supplying samba "in background" in one
of their products. (Shirish's own involvement was clearly stated to be
informal, and we must respect that.)
Me? I'm not really in a position to offer support, because although we
use Solaris/VxFS/quotas (and big-time!), we only have one installation,
which is mission-critical, and I really cannot experiment on it.
Overall, I am reasonably happy with the code (especially after Shirish
added his small but significant contribution), including the "ifdef" and
"configure[.in]" stuff.
But, at least in the Solaris aspect, you have a set-up I have never used,
so minor problems may lurk.
> I check the log with debug = 5 and I check the code:
>
> It check for mount option dev= with the devive number in /etc/mnttab:
> [2002/01/15 09:57:44, 5] smbd/quotas.c:disk_quotas(511)
> disk_quotas: looking for path "." devno=249e463
>
> After checking /etc/mnttab, VxFS filesystem don't have that option. Other
> Solaris Filesystem do:
> .
> .
> .
> /dev/vx/dsk/jumpstartdg/vxfs_quota_test /export/_quota_test vxfs
> rw,log,suid,quota 1011029439
> zbans00h:/export/global/tools /opt/corp/tools nfs
> rw,intr,suid,dev=2e800af 1011106087
Perhaps you could temporarily add a few more "DEBUG(...)" statements into
quotas.c, to log the flow of control.
The information seen in "/etc/mnttab" may be slightly different from that
returned by "getmntent(...)". The code uses "getmntent(...)" so don't get
too distracted by "/etc/mnttab".
> So I produce this little patch that use stat to found out the device
number
> of the mont point:
>
> diff -u --recursive --new-file samba-2.2.2.orig/source/smbd/quotas.c
> samba-2.2.2/source/smbd/quotas.c
> --- samba-2.2.2.orig/source/smbd/quotas.c Sat Oct 13 17:09:41 2001
> +++ samba-2.2.2/source/smbd/quotas.c Tue Jan 15 10:16:44 2002
> [...]
I cannot comment on that patch at present. Indeed, there are other things
which ought to be checked first, in particular, ...
> Also, I had to force to define VXFS_QUOTA:
> CFLAGS="-DVXFS_QUOTA" ./configure --with-quotas
That really shouldn't be necessary. The intention is that the need, if
any, for VXFS_QUOTA should be automatic. Solaris 2.6 and early VXFS
(summer 1999) needed it (we were on samba 2.0.x); Solaris 8 and VxFS 3.4
(initially still 2.0.x, later 2.2.x) seem not to need it. But, crucially,
it was automatic, via configure.
I've just taken at peek at smaba 2.2.2's "include/includes.h". It was
this that seemed to do the magic of converting configure's derived
HAVE_SYS_FS_VX_QUOTA_H into the VXFS_QUOTA required in "smbd/quotas.c".
At a glance, it seems to be absent in 2.2.2 . I just wonder whether we've
hit a migration problem from samba 2.0.x to 2.2.x ?
So it might just be worth doing the following;
1. Does your VxFS installation supply file /usr/include/sys/fs/vx_quota.h?
(If not exactly there, have a look round for "*vx*.h" files in other
likely places.)
2. If so, does your samba configuration find it?
3. If so then try adding to "include/includes.h" the lines:
#if defined(HAVE_SYS_FS_VX_QUOTA_H)
#define VXFS_QUOTA
#endif
4. If that helps, then file a bug report to the Samba Team! (You'll have
to do all the run-time testing and verification. But if circumstances
permit, I'll try to lend a hand in assisting with generating a patch.)
Ultimately it may need both a configure-related patch (i.e. the
"include/includes.h" stuff above) and perhaps a "quotas.c" one along the
lines you suggest.
(If you are wondering about the apparent complexity of converting
configure's HAVE_SYS_FS_VX_QUOTA_H into the "quotas.c" VXFS_QUOTA, it is
simply that they operate on two different levels semantically , although,
in this case, they happen to have a one-to-one correspondence.)
Hope that helps.
--
: David Lee I.T. Service :
: Systems Programmer Computer Centre :
: University of Durham :
: http://www.dur.ac.uk/t.d.lee/ South Road :
: Durham :
: Phone: +44 191 374 2882 U.K. :
More information about the samba-technical
mailing list