So I see a discrepancy in the size of the structures representing
quota sizes.
Consider
struct rquota {
int rq_bsize;
bool_t rq_active;
u_int rq_bhardlimit;
u_int rq_bsoftlimit;
u_int rq_curblocks;
u_int rq_fhardlimit;
u_int rq_fsoftlimit;
u_int rq_curfiles;
u_int rq_btimeleft;
u_int rq_ftimeleft;
};
They are all 4-byte structures (on most systems). Now, if you look at
include/fsal_types.h, they are explicitly defined as 8-byte unsigned.
typedef struct fsal_quota__ {
uint64_t bhardlimit;
uint64_t bsoftlimit;
uint64_t curblocks;
uint64_t fhardlimit;
uint64_t fsoftlimit;
uint64_t curfiles;
uint64_t btimeleft;
uint64_t ftimeleft;
uint64_t bsize;
} fsal_quota_t;
As a result, in rquota_getquota(), when you copy the values from the latter
(obtained from underlying fsal) into the former, loss of bits might occur. We are
currently seeing this for a customer with a 1024 block size and 4T quota. Do you
know if there's a reason (RFC specifications or such) that cause the former to be
32-bytes and if not, would it be OK to increase it?
The RQUOTA protocol is old, so it may well be defined as 32 bit quantities. Ganesha QUOTA
support needs some work, I know it also doesn't handle sub-mounted filesystems
correctly either.
Frank