Skip to content

Commit

Permalink
rtpref and wtpref values should not exceed rtmax and wtmax in fsinfo
Browse files Browse the repository at this point in the history
 - fix set_fs_max_rdwr_size function to set the right fsinfo response
 - during nfs mounts, the rtpref<=rtmax and wtpref<=wtmax in the fsinfo

Change-Id: I645bde8b62ead539da0650a00e0ab8a5586f40d5
Signed-off-by: JAGNYA DATTA TRIPATHY <[email protected]>
  • Loading branch information
jagnya authored and ffilz committed May 17, 2024
1 parent e8a5a2b commit 7bb7e8e
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions src/support/exports.c
Original file line number Diff line number Diff line change
Expand Up @@ -2860,14 +2860,6 @@ static void set_fs_max_rdwr_size(struct gsh_export *export, uint64_t maxread,
maxread);
export->MaxRead = maxread;
}

if (!op_ctx_export_has_option_set(EXPORT_OPTION_PREFREAD_SET) ||
(export->PrefRead > export->MaxRead)) {
LogInfo(COMPONENT_EXPORT,
"Readjusting PrefRead to %"PRIu64,
export->MaxRead);
export->PrefRead = export->MaxRead;
}
}

if (maxwrite != 0) {
Expand All @@ -2877,14 +2869,20 @@ static void set_fs_max_rdwr_size(struct gsh_export *export, uint64_t maxread,
maxwrite);
export->MaxWrite = maxwrite;
}
}

if (!op_ctx_export_has_option_set(EXPORT_OPTION_PREFWRITE_SET)
|| (export->PrefWrite > export->MaxWrite)) {
LogInfo(COMPONENT_EXPORT,
"Readjusting PrefWrite to %"PRIu64,
export->MaxWrite);
export->PrefWrite = export->MaxWrite;
}
if (export->PrefRead > export->MaxRead) {
LogInfo(COMPONENT_EXPORT,
"Readjusting PrefRead to %"PRIu64,
export->MaxRead);
export->PrefRead = export->MaxRead;
}

if (export->PrefWrite > export->MaxWrite) {
LogInfo(COMPONENT_EXPORT,
"Readjusting PrefWrite to %"PRIu64,
export->MaxWrite);
export->PrefWrite = export->MaxWrite;
}
}

Expand Down

0 comments on commit 7bb7e8e

Please sign in to comment.