diff mbox series

[v2,2/6] libmutipath: Retain device size if sysfs_get_size fails.

Message ID 20231109234616.100125-3-bmarzins@redhat.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series Two multipath features. | expand

Commit Message

Benjamin Marzinski Nov. 9, 2023, 11:46 p.m. UTC
When paths are allocated their size is initialized to 0. If they've
already set a size, and a future call to sysfs_get_size() fails during
the parsing, assume that the size hasn't changed, instead of setting it
to 0. All other failures in sysfs_get_size() already retain the existing
size.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
 libmultipath/sysfs.c | 1 -
 1 file changed, 1 deletion(-)
diff mbox series

Patch

diff --git a/libmultipath/sysfs.c b/libmultipath/sysfs.c
index c45296af..ad3d6612 100644
--- a/libmultipath/sysfs.c
+++ b/libmultipath/sysfs.c
@@ -175,7 +175,6 @@  sysfs_get_size (struct path *pp, unsigned long long * size)
 
 	if (r != 1) {
 		condlog(3, "%s: Cannot parse size attribute", pp->dev);
-		*size = 0;
 		return 1;
 	}