From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750999AbdBKRMf (ORCPT ); Sat, 11 Feb 2017 12:12:35 -0500 Received: from casper.infradead.org ([85.118.1.10]:41716 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750815AbdBKRMe (ORCPT ); Sat, 11 Feb 2017 12:12:34 -0500 Date: Sat, 11 Feb 2017 17:12:22 +0000 (GMT) From: James Simmons To: Dan Carpenter cc: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger , Oleg Drokin , wang di , Linux Kernel Mailing List , Lustre Development List Subject: Re: [PATCH 05/60] staging: lustre: llite: check request != NULL in ll_migrate In-Reply-To: <20170130113423.GB6881@mwanda> Message-ID: References: <1485648328-2141-1-git-send-email-jsimmons@infradead.org> <1485648328-2141-6-git-send-email-jsimmons@infradead.org> <20170130113423.GB6881@mwanda> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170211_171222_937205_BA367B2D X-CRM114-Status: GOOD ( 18.82 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 NO_RELAYS Informational: message was not relayed via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Sat, Jan 28, 2017 at 07:04:33PM -0500, James Simmons wrote: > > From: wang di > > > > Check if the request is NULL, before retrieve reply body > > from the request. > > > > Signed-off-by: wang di > > Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7396 > > Reviewed-on: http://review.whamcloud.com/17079 > > Reviewed-by: John L. Hammond > > Reviewed-by: Andreas Dilger > > Signed-off-by: James Simmons > > --- > > drivers/staging/lustre/lustre/llite/file.c | 41 +++++++++++++++++------------- > > 1 file changed, 23 insertions(+), 18 deletions(-) > > > > diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c > > index a1e51a5..b681e15 100644 > > --- a/drivers/staging/lustre/lustre/llite/file.c > > +++ b/drivers/staging/lustre/lustre/llite/file.c > > @@ -2656,28 +2656,33 @@ int ll_migrate(struct inode *parent, struct file *file, int mdtidx, > > if (!rc) > > ll_update_times(request, parent); > > > > I don't like how we return a non-NULL request on many error paths. It > would be simpler to understand if mdc_rename() freed request on error. > So mdc_reint() fails but we still continue? I don't understand that but > there are no comments about it. > > > > - body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY); > > - if (!body) { > > - rc = -EPROTO; > > - goto out_free; > > - } > > + if (request) { > > + body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY); > > + if (!body) { > > + rc = -EPROTO; > > + goto out_free; > > We should call ptlrpc_req_finished(request) before returning on this > path. Their are more patches coming that fix the issues you pointed out. Its just I have been pushing patches that are order independent first. I will push out the patches to address other issues with ll_migrate().