Allow -1 value to disable max_dirty_data (#1552)

This matches the man page.
This commit is contained in:
Andrew Gaul 2021-02-07 22:14:31 +09:00 committed by GitHub
parent f2c5e38724
commit 1a6d0826b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4492,11 +4492,12 @@ static int my_fuse_opt_proc(void* data, const char* arg, int key, struct fuse_ar
}
if(is_prefix(arg, "max_dirty_data=")){
off_t size = static_cast<off_t>(cvt_strtoofft(strchr(arg, '=') + sizeof(char)));
if(size < 50){
if(size >= 50){
size *= 1024 * 1024;
}else if(size != -1){
S3FS_PRN_EXIT("max_dirty_data option must be at least 50 MB.");
return -1;
}
size *= 1024 * 1024;
max_dirty_data = size;
return 0;
}