Skip to content

Commit

Permalink
libmultipath: fix max_sectors_kb on adding path
Browse files Browse the repository at this point in the history
A user can change the value of max_sectors_kb on the multipath device
and its path devices.
So when a path is deleted and then re-added, its value will not be the
same as the multipath device. In that case the IOs could be mis-sized.

On reload, this patch re-apply max_sectors_kb value of the multipath
device on its path devices.

Signed-off-by: Etienne AUJAMES <[email protected]>
Reviewed-by: Martin Wilck <[email protected]>
  • Loading branch information
ajmes authored and mwilck committed Aug 29, 2023
1 parent bd72039 commit bbb77f3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libmultipath/configure.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,11 +595,12 @@ sysfs_set_max_sectors_kb(struct multipath *mpp, int is_reload)
ssize_t len;
int i, j, ret, err = 0;
struct udev_device *udd;
int max_sectors_kb;
int max_sectors_kb = mpp->max_sectors_kb;

if (mpp->max_sectors_kb == MAX_SECTORS_KB_UNDEF)
/* by default, do not initialize max_sectors_kb on the device */
if (max_sectors_kb == MAX_SECTORS_KB_UNDEF && !is_reload)
return 0;
max_sectors_kb = mpp->max_sectors_kb;
/* on reload, re-apply the user tuning on all the path devices */
if (is_reload) {
if (!has_dm_info(mpp) &&
dm_get_info(mpp->alias, &mpp->dmi) != 0) {
Expand Down

0 comments on commit bbb77f3

Please sign in to comment.