Bug 4458 - Wrong disk size when reshare a NFS disk with quota
Summary: Wrong disk size when reshare a NFS disk with quota
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: File Services (show other bugs)
Version: 3.0.24
Hardware: Sparc Windows XP
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
Depends on:
Reported: 2007-03-21 02:22 UTC by James Ytterstene
Modified: 2014-11-06 13:09 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description James Ytterstene 2007-03-21 02:22:08 UTC

We mount a NFS filesystem to a server where wh reshare it using samba. The NFS disk has user quota enabled. Problem is that when we look at the disk from the windows environment we se all data wrong. Size, used space and so on is all wrong. I have looked in the source code for smbd/quota.c and even checked with log level = 10. I get this result.

[2007/03/20 12:54:39, 10] smbd/quotas.c:nfs_quotas(545)
  nfs_quotas: Let`s look at D a bit closer... status "1" bsize "1024" active? "1" bhard "5120000" bsoft "5120000" curb "1016604"
[2007/03/20 12:54:39, 5] smbd/quotas.c:nfs_quotas(567)
  nfs_quotas: For path "perh01" returning  bsize 512, dfree 4103396, dsize 5120000

I get status = 1 that say quota data is ok and the blocksize from is 1024. If i check the source i find the following code

        switch ( quotastat ) {
        case 1:
                DEBUG(9,("nfs_quotas: Good quota data\n"));
                D.dqb_bsoftlimit = gqr.getquota_rslt_u.gqr_rquota.rq_bsoftlimit;
                D.dqb_bhardlimit = gqr.getquota_rslt_u.gqr_rquota.rq_bhardlimit;
                D.dqb_curblocks = gqr.getquota_rslt_u.gqr_rquota.rq_curblocks;
        DEBUG(10,("nfs_quotas: Let`s look at D a bit closer... status \"%i\" bsize \"%i\" active? \"%i\" bhard \"%i\" bsoft \"%i\" curb \"%i\" \n",

        *bsize = gqr.getquota_rslt_u.gqr_rquota.rq_bsize;
        *dsize = D.dqb_bsoftlimit;

        if (D.dqb_curblocks == D.dqb_curblocks == 1)
                *bsize = 512;

From the debug i can read that D.dqb_curblocks = gqr.getquota_rslt_u.gqr_rquota.rq_curblocks = 5120000

Now im not that good at c, but the last if statement is activated and the *bsize is changed to 512 even tho i can see from debug that the quota returned 1024.

I have made a test and changed the value to 1024 and then all data is correct

Comment 1 Björn Jacke 2014-11-06 13:09:12 UTC
sorry for not coming to this earlier. I think the NFS quota support is fixed since a while. I'm pretty sure NFS quotas are working since some years now (Samba 4.0 at least ...). Can you confirm it works for you, too?