Opened 3 years ago

Last modified 12 months ago

#324 new defect

mdc_set_$mdir_quota doesn't handle reducing quota correctly

Reported by: Eric Swenson Owned by: Eric Swenson
Priority: major Milestone: MR12.9
Component: Administration Version: MR12.8
Keywords: Cc:

Description

If, for example, you have a master directory >XFER with 80090 records of quota, and 66539 records of quota used, and you attempt to reduce the quota, by, say 1000 records with this command:

smdq >XFER -1000

The command will fail if the quota account doesn't have have 79090 records of quota available. This is completely wrong, since you are actually returning quota to the quota account, not charging that quota account additional quota.

The bug is in mdc_set_$mdir_quota, at about line 296, which looks like this:

          if quota_used > acctent.quota
          then do;                                          /* No quota in account */
                    code = error_table_$mdc_no_quota;
                    go to term_return;
               end;

This check should not be performed if the value of new_quota (in this example -1000) is negative.

This bug results in the error error_table_$mdc_no_quota being returned even when you are reducing the master directory quota.

Change History (2)

comment:1 by Eric Swenson, 3 years ago

The above-described fix is not good enough because the existing code further sets the quota available value for the quota account to the quota_used, when, in fact, it should set it to its current value minus the quota moved.

Last edited 12 months ago by Eric Swenson (previous) (diff)

comment:2 by Eric Swenson, 12 months ago

I currently can't reproduce this bug any more. Not sure why.

Note: See TracTickets for help on using tickets.