FreeBSD Bugzilla – Attachment 185645 Details for
Bug 221697
/usr/bin/quota incorrectly calculates NFS quota values.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Better and safer patch
quota.patch (text/plain), 1.44 KB, created by
Stephen Usher
on 2017-08-21 18:32:31 UTC
(
hide
)
Description:
Better and safer patch
Filename:
MIME Type:
Creator:
Stephen Usher
Created:
2017-08-21 18:32:31 UTC
Size:
1.44 KB
patch
obsolete
>--- quota.c.orig 2017-08-21 17:29:51.322721000 +0100 >+++ quota.c 2017-08-21 19:24:50.952719000 +0100 >@@ -563,6 +563,26 @@ > return (1); > } > >+static uint32_t >+scalenfsquota(uint32_t bsize, uint32_t value) >+{ >+ uint32_t retval = 0L; >+ >+ if (bsize == 0L) >+ return(retval); >+ >+ if (bsize > DEV_BSIZE) >+ { >+ retval = value * (bsize / DEV_BSIZE); >+ } >+ else >+ { >+ retval = value / (DEV_BSIZE / bsize); >+ } >+ >+ return(retval); >+} >+ > static int > getnfsquota(struct statfs *fst, struct quotause *qup, long id, int quotatype) > { >@@ -619,14 +639,11 @@ > gettimeofday(&tv, NULL); > /* blocks*/ > dqp->dqb_bhardlimit = >- gq_rslt.getquota_rslt_u.gqr_rquota.rq_bhardlimit * >- (gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE); >+ scalenfsquota(gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize, gq_rslt.getquota_rslt_u.gqr_rquota.rq_bhardlimit); > dqp->dqb_bsoftlimit = >- gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsoftlimit * >- (gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE); >+ scalenfsquota(gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize, gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsoftlimit); > dqp->dqb_curblocks = >- gq_rslt.getquota_rslt_u.gqr_rquota.rq_curblocks * >- (gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE); >+ scalenfsquota(gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize, gq_rslt.getquota_rslt_u.gqr_rquota.rq_curblocks); > /* inodes */ > dqp->dqb_ihardlimit = > gq_rslt.getquota_rslt_u.gqr_rquota.rq_fhardlimit;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 221697
:
185644
| 185645