LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] staging: lustre: Fix an error handling path in 'client_common_fill_super()'
@ 2018-05-12  6:33 Christophe JAILLET
  2018-05-12  8:32 ` [lustre-devel] " Dilger, Andreas
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2018-05-12  6:33 UTC (permalink / raw)
  To: oleg.drokin, andreas.dilger, jsimmons, gregkh, neilb,
	aastha.gupta4104, santhameena13
  Cc: lustre-devel, devel, linux-kernel, kernel-janitors, Christophe JAILLET

According to error handling path before and after this one, we should go
to 'out_md_fid' here, instead of 'out_md', if 'obd_connect()' fails.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
---
The last goto 'out_lock_cn_cb' looks spurious but is correct.
In case of error, 'd_make_root()' performs a 'iput()', so skipping it in
the error handling path lokks fine to me.
---
 drivers/staging/lustre/lustre/llite/llite_lib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 60dbe888e336..83eb2da2c9ad 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -400,11 +400,11 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt)
 		LCONSOLE_ERROR_MSG(0x150,
 				   "An OST (dt %s) is performing recovery, of which this client is not a part.  Please wait for recovery to complete, abort, or time out.\n",
 				   dt);
-		goto out_md;
+		goto out_md_fid;
 	} else if (err) {
 		CERROR("%s: Cannot connect to %s: rc = %d\n",
 		       sbi->ll_dt_exp->exp_obd->obd_name, dt, err);
-		goto out_md;
+		goto out_md_fid;
 	}
 
 	sbi->ll_dt_exp->exp_connect_data = *data;
-- 
2.17.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [lustre-devel] [PATCH] staging: lustre: Fix an error handling path in 'client_common_fill_super()'
  2018-05-12  6:33 [PATCH] staging: lustre: Fix an error handling path in 'client_common_fill_super()' Christophe JAILLET
@ 2018-05-12  8:32 ` Dilger, Andreas
  0 siblings, 0 replies; 2+ messages in thread
From: Dilger, Andreas @ 2018-05-12  8:32 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Drokin, Oleg, James Simmons, Greg Kroah-Hartman, NeilBrown,
	aastha.gupta4104, santhameena13, devel, kernel-janitors,
	linux-kernel, lustre-devel

On May 12, 2018, at 00:33, Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:
> 
> According to error handling path before and after this one, we should go
> to 'out_md_fid' here, instead of 'out_md', if 'obd_connect()' fails.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Good catch.

Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>

> ---
> The last goto 'out_lock_cn_cb' looks spurious but is correct.
> In case of error, 'd_make_root()' performs a 'iput()', so skipping it in
> the error handling path lokks fine to me.
> ---
> drivers/staging/lustre/lustre/llite/llite_lib.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
> index 60dbe888e336..83eb2da2c9ad 100644
> --- a/drivers/staging/lustre/lustre/llite/llite_lib.c
> +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
> @@ -400,11 +400,11 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt)
> 		LCONSOLE_ERROR_MSG(0x150,
> 				   "An OST (dt %s) is performing recovery, of which this client is not a part.  Please wait for recovery to complete, abort, or time out.\n",
> 				   dt);
> -		goto out_md;
> +		goto out_md_fid;
> 	} else if (err) {
> 		CERROR("%s: Cannot connect to %s: rc = %d\n",
> 		       sbi->ll_dt_exp->exp_obd->obd_name, dt, err);
> -		goto out_md;
> +		goto out_md_fid;
> 	}
> 
> 	sbi->ll_dt_exp->exp_connect_data = *data;
> -- 
> 2.17.0
> 
> _______________________________________________
> lustre-devel mailing list
> lustre-devel@lists.lustre.org
> http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-12  8:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-12  6:33 [PATCH] staging: lustre: Fix an error handling path in 'client_common_fill_super()' Christophe JAILLET
2018-05-12  8:32 ` [lustre-devel] " Dilger, Andreas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).