From: NeilBrown Date: Thu, 1 Mar 2018 23:31:25 +0000 (+1100) Subject: staging: lustre: obd_mount: use correct niduuid suffix. X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=436630983b006e3fd3ada042da70a11052318d42;p=linux.git staging: lustre: obd_mount: use correct niduuid suffix. Commit 4f016420d368 ("Staging: lustre: obdclass: Use kasprintf") moved some sprintf() calls earlier in the code to combine them with memory allocation and create kasprintf() calls. In one case, this code movement moved the sprintf to a location where the values being formatter were different. In particular sprintf(niduuid, "%s_%x", mgcname, i); was move from *after* the line i = 0; to a location where the value of 'i' was at least 1. This cause the wrong name to be formatted, and triggers CERROR("del MDC UUID %s failed: rc = %d\n", niduuid, rc); at unmount time. So use '0' instead of 'i'. Fixes: 4f016420d368 ("Staging: lustre: obdclass: Use kasprintf") Signed-off-by: NeilBrown Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c index acc1ea773c9c6..f5e8214ac37b9 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c @@ -243,7 +243,7 @@ int lustre_start_mgc(struct super_block *sb) libcfs_nid2str_r(nid, nidstr, sizeof(nidstr)); mgcname = kasprintf(GFP_NOFS, "%s%s", LUSTRE_MGC_OBDNAME, nidstr); - niduuid = kasprintf(GFP_NOFS, "%s_%x", mgcname, i); + niduuid = kasprintf(GFP_NOFS, "%s_%x", mgcname, 0); if (!mgcname || !niduuid) { rc = -ENOMEM; goto out_free;