[PATCH] super-intel: respect IMSM_DEVNAME_AS_SERIAL flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



IMSM_DEVNAME_AS_SERIAL flag was respected only when searching
serial using nvme or scsi device wasn't successful. This
flag shall be applied first, to have user settings with
the highest priority.

Signed-off-by: Kinga Tanska <kinga.tanska@xxxxxxxxx>
---
 super-intel.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index 6bdd5c4c..880e5977 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -4172,17 +4172,17 @@ static int imsm_read_serial(int fd, char *devname,
 
 	memset(buf, 0, sizeof(buf));
 
+	if (check_env("IMSM_DEVNAME_AS_SERIAL")) {
+		memset(serial, 0, serial_buf_len);
+		fd2devname(fd, (char *) serial);
+		return 0;
+	}
+
 	rv = nvme_get_serial(fd, buf, sizeof(buf));
 
 	if (rv)
 		rv = scsi_get_serial(fd, buf, sizeof(buf));
 
-	if (rv && check_env("IMSM_DEVNAME_AS_SERIAL")) {
-		memset(serial, 0, MAX_RAID_SERIAL_LEN);
-		fd2devname(fd, (char *) serial);
-		return 0;
-	}
-
 	if (rv != 0) {
 		if (devname)
 			pr_err("Failed to retrieve serial for %s\n",
-- 
2.26.2





[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux