Commit d754032 1 parent e08a0ba commit d754032 Copy full SHA for d754032
File tree 3 files changed +18
-2
lines changed
3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change
1
+ Enhancement: differentiate quota for user types in EOS
2
+
3
+ We now assign a different initial quota to users depending
4
+ on their type, whether PRIMARY or not.
5
+
6
+ https://github.com/cs3org/reva/pull/4720
Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ type Config struct {
29
29
// DefaultQuotaBytes sets the default maximum bytes available for a user
30
30
DefaultQuotaBytes uint64 `mapstructure:"default_quota_bytes"`
31
31
32
+ // DefaultSecondaryQuotaBytes sets the default maximum bytes available for a secondary user
33
+ DefaultSecondaryQuotaBytes uint64 `mapstructure:"default_secondary_quota_bytes"`
34
+
32
35
// DefaultQuotaFiles sets the default maximum files available for a user
33
36
DefaultQuotaFiles uint64 `mapstructure:"default_quota_files"`
34
37
Original file line number Diff line number Diff line change @@ -101,6 +101,9 @@ func (c *Config) ApplyDefaults() {
101
101
if c .DefaultQuotaBytes == 0 {
102
102
c .DefaultQuotaBytes = 2000000000000 // 1 TB logical
103
103
}
104
+ if c .DefaultSecondaryQuotaBytes == 0 {
105
+ c .DefaultSecondaryQuotaBytes = c .DefaultQuotaBytes
106
+ }
104
107
if c .DefaultQuotaFiles == 0 {
105
108
c .DefaultQuotaFiles = 1000000 // 1 Million
106
109
}
@@ -1489,12 +1492,16 @@ func (fs *eosfs) createNominalHome(ctx context.Context) error {
1489
1492
return err
1490
1493
}
1491
1494
1492
- // set quota for user
1495
+ // set quota for user, depending on its type
1496
+ quotaBytes := fs .conf .DefaultQuotaBytes
1497
+ if u .Id .Type != userpb .UserType_USER_TYPE_PRIMARY {
1498
+ quotaBytes = fs .conf .DefaultSecondaryQuotaBytes
1499
+ }
1493
1500
quotaInfo := & eosclient.SetQuotaInfo {
1494
1501
Username : u .Username ,
1495
1502
UID : auth .Role .UID ,
1496
1503
GID : auth .Role .GID ,
1497
- MaxBytes : fs . conf . DefaultQuotaBytes ,
1504
+ MaxBytes : quotaBytes ,
1498
1505
MaxFiles : fs .conf .DefaultQuotaFiles ,
1499
1506
QuotaNode : fs .conf .QuotaNode ,
1500
1507
}
You can’t perform that action at this time.
0 commit comments