Received: by 10.192.165.148 with SMTP id m20csp157285imm; Tue, 1 May 2018 20:06:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr2S+qiAiAmjmw5HVAYAAZfWUe7sJoc/gdI708qYjaceLN7CNusaBkofOEP+vIQFpwA8mE8 X-Received: by 2002:a63:7258:: with SMTP id c24-v6mr15013947pgn.453.1525230415060; Tue, 01 May 2018 20:06:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525230415; cv=none; d=google.com; s=arc-20160816; b=QI+0R9itDEZwjLa4Gr+pcwjP2zVadb65/krW3+VUz4L6OCkoDRWl21dta30cbVHCfb gUMMaRLpPco7zTFaR2MdrVKYQkFN2SXSbPwxWYjBfhmnmF+7hpUWGwQODfKzdsk4GrpK nHQJ0OwWmIBOdOafO15x9plcJO7C+tD0gjYXL5PH0wuSLIG+2etCGMbZUOAtBvg7K10c 8MQhicMy/wBxN79ya08b5io6iENZm/vM4qai52XamkRnXeQnG8UWLYX3aCT31XwO9uZE MErIq32KOpBIZRWvDVwkrEYeZz/uZVQnOX73b+NeNq6UZK0sffvRXhrfDBWv8cA2EH50 ey/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=me45gw7ITYDQFqNbTKg7UDDx+WxtdXn8rcibZTinnJg=; b=X35Ft/y0wKGJq1hXklMymQcdrsNVyWqLVlTxLaBwzbpAiqRf06GLxat2MowFQuKlN1 +OvZO93VnYEDNCPE1Ce/uEv22sS8doREIl8fXd4kFVE2Fsuo1bwIZTNScca2QDDko6nA wq1WwXHzFIZL37uINp4T4Ck1bOkgRFG/afwQP1b+oeOtYf4c6Wo1lDQ+Epxx05uHikmx BrFP0jVto6580jZTXcu//ywXnFxYERccFuWyCAWVG2pyQ+x8w0Ilacb3CSVICtBU1v3Z eQPHXvNJbVf0zbiJgPYliiC9fBQ4ZxUI4uwZJbXQVQmw3JQ7lKC5xg+BGERlLAKwsL1g IS1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=b4CifmJK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x6-v6si7763205pgc.366.2018.05.01.20.06.40; Tue, 01 May 2018 20:06:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=b4CifmJK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751649AbeEBDGC (ORCPT + 99 others); Tue, 1 May 2018 23:06:02 -0400 Received: from casper.infradead.org ([85.118.1.10]:45708 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751598AbeEBDFp (ORCPT ); Tue, 1 May 2018 23:05:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: Message-ID:In-Reply-To:Subject:cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=me45gw7ITYDQFqNbTKg7UDDx+WxtdXn8rcibZTinnJg=; b=b4CifmJKl8wOy7ZXxLq7gzvmJ e7XZzSe1IdLQ3RLbYihRA+IxwEuDH/E27+srdJp499gxZKU3kPlYR7A5wdJvAfBz8Jqia0BK0GzDo Hi3MzX6eIx7lMVy6DX/dENlYInJejiRhoqTiuVhw78eG8oYtOCpYX+1S7eDKA/AsM+w9hz40NQoOQ /QJJuyoWhGlBDVWfFbPATeWfq2M01duVLbLcStCMGWKij9Pny6t7QkVAHwImwbQWqO9yQr2rGstuF jFDIbEzEVJC/Pa3OXTHirBKpWe509L2CE8y9vV/Atyr//w0XCTtoDF1/vMGmqwZWaDapM++tBqCTj oWHcVN6XA==; Received: from jsimmons (helo=localhost) by casper.infradead.org with local-esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fDi5L-0002YS-W5; Wed, 02 May 2018 03:05:41 +0000 Date: Wed, 2 May 2018 04:05:39 +0100 (BST) From: James Simmons To: NeilBrown cc: Oleg Drokin , Greg Kroah-Hartman , Andreas Dilger , Linux Kernel Mailing List , Lustre Development List Subject: Re: [PATCH 10/10] staging: lustre: fix error deref in ll_splice_alias(). In-Reply-To: <152514675919.17843.11688659715084804936.stgit@noble> Message-ID: References: <152514658325.17843.11455067361317157487.stgit@noble> <152514675919.17843.11688659715084804936.stgit@noble> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) 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-20180502_040540_021520_AA8D8C41 X-CRM114-Status: GOOD ( 16.13 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 NO_RELAYS Informational: message was not relayed via SMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > d_splice_alias() can return an ERR_PTR(). > If it does while debugging is enabled, the following > CDEBUG() will dereference that error and crash. > > So add appropriate checking, and provide a separate > debug message for the error case. Yeah!!! It fixed the issues. Thank you. Reviewed-by: James Simmons > Reported-by: James Simmons > Fixes: e9d4f0b9f559 ("staging: lustre: llite: use d_splice_alias for directories.") > Signed-off-by: NeilBrown > --- > drivers/staging/lustre/lustre/llite/namei.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c > index 6c9ec462eb41..24a6873d86a2 100644 > --- a/drivers/staging/lustre/lustre/llite/namei.c > +++ b/drivers/staging/lustre/lustre/llite/namei.c > @@ -442,11 +442,15 @@ struct dentry *ll_splice_alias(struct inode *inode, struct dentry *de) > } else { > struct dentry *new = d_splice_alias(inode, de); > > + if (IS_ERR(new)) > + CDEBUG(D_DENTRY, "splice inode %p as %pd gives error %lu\n", > + inode, de, PTR_ERR(new)); > if (new) > de = new; > } > - CDEBUG(D_DENTRY, "Add dentry %p inode %p refc %d flags %#x\n", > - de, d_inode(de), d_count(de), de->d_flags); > + if (!IS_ERR(de)) > + CDEBUG(D_DENTRY, "Add dentry %p inode %p refc %d flags %#x\n", > + de, d_inode(de), d_count(de), de->d_flags); > return de; > } > > > >