Bug 3272 - in nfs quotas, bsize is always set to 512
in nfs quotas, bsize is always set to 512
Status: RESOLVED FIXED
Product: Samba 3.6
Classification: Unclassified
Component: File services
3.6.7
Sparc Solaris
: P3 normal
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-11-18 09:49 UTC by Ted Zlatanov
Modified: 2012-10-14 19:32 UTC (History)
3 users (show)

See Also:
bjacke: review? (metze)


Attachments
patch for master to fix this (899 bytes, patch)
2012-09-06 08:34 UTC, Björn Jacke
obnox: review+
bjacke: review? (metze)
bjacke: review? (vl)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ted Zlatanov 2005-11-18 09:49:52 UTC
smbd/quotas.c, line 546:

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

this will always set the returned bsize to 512.  Our EMC system, for example, returns a block size 8192 so all user quotas are underreported incorrectly by a factor of 16.

Logs, etc. are available on request.  Here's the essential extract:
[2005/11/18 11:28:27, 10] smbd/quotas.c:nfs_quotas(541)
  nfs_quotas: Let`s look at D a bit closer... status "1" bsize "8192" active? "1" bhard "625000" bsoft "625000" curb "315573"
[2005/11/18 11:28:27, 5] smbd/quotas.c:nfs_quotas(563)
  nfs_quotas: For path "/hpfs/data/homefs/tzz" returning  bsize 512, dfree 309427, dsize 625000

Thanks
Ted
Comment 1 Lonnie Olson 2005-12-20 17:05:32 UTC
Exactly the same issue on 
FreeBSD 4.10-RELEASE-p2
Samba 3.0.20b

[2005/12/20 16:35:42, 10] smbd/quotas.c:nfs_quotas(1077)
  nfs_quotas: Let`s look at D a bit closer... status "1" bsize "4096" active? "1" bhard "4718592" bsoft "4718592" curb "1826663" 
[2005/12/20 16:35:42, 5] smbd/quotas.c:nfs_quotas(1104)
  nfs_quotas: For path "/vol/vol0/home" returning  bsize 512, dfree 2891929, dsize 4718592

I commented out the block mentioned and rebuilt, restarted.  Quotas now report correctly.
Comment 2 Lawrence V Cipriani 2007-03-19 12:01:09 UTC
The same error occurs in smbd/quotas.c twice, once at 550 and again
at line 1093 ( 3.0.24)

source/smbd/quotas.c: missing logical operator near line 550
      if (D.dqb_curblocks == D.dqb_curblocks == 1)

source/smbd/quotas.c: missing logical operator near line 1093
      if (D.dqb_curblocks == D.dqb_curblocks == 1)
Comment 3 Björn Jacke 2012-09-06 08:34:53 UTC
Created attachment 7862 [details]
patch for master to fix this

resetting the block size makes no sense. In master this only affects Solaris as the other platforms use sysquota's nfs quota code now which doesn't do such stuff.
Comment 4 Michael Adam 2012-09-06 10:33:03 UTC
(In reply to comment #3)
> Created attachment 7862 [details]
> patch for master to fix this
> 
> resetting the block size makes no sense. In master this only affects Solaris as
> the other platforms use sysquota's nfs quota code now which doesn't do such
> stuff.

Hm, not certain: a couple of other implementations do *bsize = DEV_BSIZE; here ore something equivalent.

If this is wrong (in the sunos path), then possibly other implementations are wrong as well.
Comment 5 Karolin Seeger 2012-09-18 06:52:38 UTC
Re-assigning to Björn for commenting.
Comment 6 Björn Jacke 2012-09-18 09:00:25 UTC
the customer said it works for him and to me this looks very sane. I think Michael mainly is not certain if other quota methods are broken or not if I read the comment right :-). (And indeed, other quota methods have issues with the base block vs. quota block size with certain filesystems, but that's another not jet existing bug report, this should not be discussed here ;-))
Comment 7 Stefan Metzmacher 2012-09-29 19:41:25 UTC
(In reply to comment #6)
> the customer said it works for him and to me this looks very sane. I think
> Michael mainly is not certain if other quota methods are broken or not if I
> read the comment right :-). (And indeed, other quota methods have issues with
> the base block vs. quota block size with certain filesystems, but that's
> another not jet existing bug report, this should not be discussed here ;-))

I think the patch looks fine.
Comment 8 Karolin Seeger 2012-10-04 09:01:08 UTC
Pushed to v3-6-test (and verified that it's already included in v4-0-test).
Closing out bug report.

Thanks!