Re: [PATCH] mdadm/mdopen: check system("modprobe ...") return

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

 





On 10/25/2017 06:35 PM, Erik Berg wrote:
Build system gives an error with warn_unused_result, this should fix
that.

Hi, Erik;
According to some suggestions from Neil Brown, I have sent the patch in 16th Oct.
please refer to the mail:
[PATCH] mdadm/mdopen: create new function create_named_array for writing to new_array


Thanks,
-Zhilong
---
  mdopen.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/mdopen.c b/mdopen.c
index dcdc6f2..8cd8507 100644
--- a/mdopen.c
+++ b/mdopen.c
@@ -313,7 +313,10 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
  			udev_block(devnm);
  		fd = open("/sys/module/md_mod/parameters/new_array", O_WRONLY);
  		if (fd < 0 && errno == ENOENT) {
-			system("modprobe md_mod");
+			if(system("modprobe md_mod")) {
+				pr_err("check modprobe md_mod results\n");
+				return -1;
+			}
  			fd = open("/sys/module/md_mod/parameters/new_array", O_WRONLY);
  		}
  		if (fd >= 0) {

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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