-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix enableSumIndir problem #2339
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -198,7 +198,8 @@ CURVEFS_ERROR FuseClient::FuseOpInit(void *userdata, | |
} | ||
inodeManager_->SetFsId(fsInfo_->fsid()); | ||
dentryManager_->SetFsId(fsInfo_->fsid()); | ||
enableSumInDir_ = fsInfo_->enablesumindir() && !FLAGS_enableCto; | ||
// enableSumInDir_ = fsInfo_->enablesumindir() && !FLAGS_enableCto; | ||
enableSumInDir_ = fsInfo_->enablesumindir(); | ||
if (fsInfo_->has_recycletimehour()) { | ||
enableSumInDir_ = enableSumInDir_ && (fsInfo_->recycletimehour() == 0); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the code review. The code patch looks okay on the surface. It removes the FLAGS_enableCto check, which might have been used to disable the enableSumInDir_ flag. However, it is important to determine why this change is being implemented and if the removal of this check can have any adverse effects on the application. Also, the code should be tested thoroughly to ensure that this change does not introduce any bugs or security vulnerabilities. Additionally, it is important to consider if there are any potential performance improvements that can be made. |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,6 +113,9 @@ void FsInfoWrapper::AddMountPoint(const Mountpoint& mp) { | |
*p = mp; | ||
|
||
fsInfo_.set_mountnum(fsInfo_.mountnum() + 1); | ||
if(fsInfo_.mountnum()>1){ | ||
fsInfo_.set_enablesumindir(false); | ||
} | ||
} | ||
|
||
FSStatusCode FsInfoWrapper::DeleteMountPoint(const Mountpoint& mp) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. with the code review:
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the code review,
First of all, it looks like the code patch is trying to resolve a specific bug or issue. From the context, it appears that the patch is attempting to set the variable enableSumInDir_, which is used to enable summaries in a directory.
The patch removes the existing condition of !FLAGS_enableCto, which means that the variable will now be set regardless of the value of FLAGS_enableCto. While this may be necessary in order to resolve the issue, it would be helpful to better understand why the FLAGS_enableCto condition was removed and if there are any potential risks to removing it. Additionally, it might be helpful to add a comment explaining why the condition was removed in order to make the code more understandable.
Overall, the patch looks reasonable and should help to resolve the issue. However, it would be helpful to get a better understanding of why the FLAGS_enableCto condition was removed in order to ensure that there are no unintended consequences.