Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3289466imm; Sun, 29 Jul 2018 15:08:51 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdHEv1fyBSNS6b0ujIIVWc5tgI6ZiDnXm7u75AChNQdkOkT4G68hi/2V0I53nXGcXmSXD4V X-Received: by 2002:a63:d613:: with SMTP id q19-v6mr13969127pgg.327.1532902130945; Sun, 29 Jul 2018 15:08:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532902130; cv=none; d=google.com; s=arc-20160816; b=IVfg7nUhHSbRDzZGEPfeTKGGqp6JZwOZNBEs6ME9nwOaLWNCV1o5QOR/dsHL1hCkB1 4lqBGO2cpOc3du6YBhmt9T/NVtAik+k6raVjaXuovyUbCd9hFwhBwwenCzP8t7rZf8p+ 17hD7e33gAoSl+lpYdrtEZD+1FK5nijFVlfpC4TL59f+AaFkpxD+z/5965DbMg3hgd8G V09PPiAmXYQLtHIxIbAH+p24X3Y4NH0I729IMN9IftLzzC9C7uX/n28IR5DdsyUeM3TH qIsM0aXKrHZ/OWCBta74vxXSua/Y1nG8SLXL/r0dO/pyD7QZ7bth/aTFN+Veim2G5mJ9 lPHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=1yBPpWpMAoAaDrWFXvMJLDwPJbYM3KmUJaRv5YKKL8o=; b=M0GqzuMzP4EInpW+UwNhG1Ibx1AsuuWFHfesHxHRIUDIp3fZLRJRdufBGHrSSWqbFG MYP1O+8zg0T1T0g6PIThcUqgjPaG5E0QCV/x2kNsLdlZZjSQrbKpAmGj8DQzgjq43QnN 2UWAhuBjx1M9133GLODABIkcMyytpGpFH7vnPZBGBhHRR61kXTRabM+1KhpgquLA234I oAfsesO7YmvYmNfutaA/StruH7rmYT0NWM5mKJyhn9JaQMbxV4+DFpwRLT4cVXbUPGoW BHf4kpplspPll8KhGMCspXNtPGM41DXGBPrUfHj5yHoYli1lWhZtPRgU+ekdRYVlqL6r CWHQ== ARC-Authentication-Results: i=1; mx.google.com; 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 185-v6si9776187pgj.511.2018.07.29.15.08.37; Sun, 29 Jul 2018 15:08:50 -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; 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 S1732133AbeG2Xg5 (ORCPT + 99 others); Sun, 29 Jul 2018 19:36:57 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:51562 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726835AbeG2Xg4 (ORCPT ); Sun, 29 Jul 2018 19:36:56 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fjto6-0003VT-Ae; Sun, 29 Jul 2018 22:04:54 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: Linus Torvalds , linux-kernel@vger.kernel.org, Miklos Szeredi Subject: [PATCH 05/16] ufs: switch to discard_new_inode() Date: Sun, 29 Jul 2018 23:04:42 +0100 Message-Id: <20180729220453.13431-5-viro@ZenIV.linux.org.uk> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180729220453.13431-1-viro@ZenIV.linux.org.uk> References: <20180729220317.GB30522@ZenIV.linux.org.uk> <20180729220453.13431-1-viro@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Al Viro we don't want open-by-handle to pick an in-core inode that has failed setup halfway through. Signed-off-by: Al Viro --- fs/ufs/ialloc.c | 3 +-- fs/ufs/namei.c | 9 +++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/fs/ufs/ialloc.c b/fs/ufs/ialloc.c index e1ef0f0a1353..02c0a4be4212 100644 --- a/fs/ufs/ialloc.c +++ b/fs/ufs/ialloc.c @@ -343,8 +343,7 @@ struct inode *ufs_new_inode(struct inode *dir, umode_t mode) fail_remove_inode: mutex_unlock(&sbi->s_lock); clear_nlink(inode); - unlock_new_inode(inode); - iput(inode); + discard_new_inode(inode); UFSD("EXIT (FAILED): err %d\n", err); return ERR_PTR(err); failed: diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c index d5f43ba76c59..9ef40f100415 100644 --- a/fs/ufs/namei.c +++ b/fs/ufs/namei.c @@ -43,8 +43,7 @@ static inline int ufs_add_nondir(struct dentry *dentry, struct inode *inode) return 0; } inode_dec_link_count(inode); - unlock_new_inode(inode); - iput(inode); + discard_new_inode(inode); return err; } @@ -142,8 +141,7 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry, out_fail: inode_dec_link_count(inode); - unlock_new_inode(inode); - iput(inode); + discard_new_inode(inode); return err; } @@ -198,8 +196,7 @@ static int ufs_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode) out_fail: inode_dec_link_count(inode); inode_dec_link_count(inode); - unlock_new_inode(inode); - iput (inode); + discard_new_inode(inode); out_dir: inode_dec_link_count(dir); return err; -- 2.11.0