-
Notifications
You must be signed in to change notification settings - Fork 524
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_enable #2340
fix_enable #2340
Changes from 1 commit
cdec899
893411f
d4df8e2
dc787ae
9dc3047
5eebed8
4f83f1d
92f7273
7f8d871
245d0b1
4b0f9cf
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,7 @@ CURVEFS_ERROR FuseClient::FuseOpInit(void *userdata, | |
} | ||
inodeManager_->SetFsId(fsInfo_->fsid()); | ||
dentryManager_->SetFsId(fsInfo_->fsid()); | ||
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. with code review: The patch changes the code from disabling enableSumInDir_ if FLAGS_enableCto is set to not disabling it regardless of the value of FLAGS_enableCto. This change seems reasonable as it would allow enableSumInDir_ to be enabled even if FLAGS_enableCto is set. However, it is important to note that this might have unintended consequences depending on the implementation of FLAGS_enableCto. It is recommended to check the implementation of FLAGS_enableCto and ensure that this change does not have any unexpected side-effects. |
||
|
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) { | ||
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.
|
||
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. the code review
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 understanding the code. The code patch adds a new line in the AddMountPoint method, which sets the enablesumindir field to false if the mountnum is greater than 1. This is necessary because the mountnum indicates the number of mount points, and if there are more than one mount points, then enablesumindir should be false. From a bug risk perspective, this patch looks okay. However, it would be beneficial to add a comment that explains the purpose of setting the enablesumindir field to false when mountnum is greater than 1. This will make it easier for other developers to understand the code. Additionally, it might be worth adding a check to make sure that mountnum is not greater than the maximum allowed mount points, before setting enablesumindir to false. |
||
|
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
The given patch looks correct, it is changing the value of enableSumInDir_ to be equal to the "enablesumindir" value from fsInfo_, removing the FLAGS_enableCto condition.
It would be beneficial to add a comment explaining the purpose of this change and any assumptions made when making this change. This will help other developers understand why this change was made and prevent any unexpected behavior.
It is also important to ensure that this change does not break any existing functionality. Thorough testing should be done to ensure that any possible scenarios are tested before pushing this change to production.