From patchwork Fri May 15 07:20:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 11550687 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6A00814C0 for ; Fri, 15 May 2020 07:37:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 531A6206F4 for ; Fri, 15 May 2020 07:37:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mykernel.net header.i=cgxu519@mykernel.net header.b="YWELHkij" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726797AbgEOHhp (ORCPT ); Fri, 15 May 2020 03:37:45 -0400 Received: from sender2-of-o52.zoho.com.cn ([163.53.93.247]:21124 "EHLO sender2-of-o52.zoho.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726726AbgEOHhm (ORCPT ); Fri, 15 May 2020 03:37:42 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1589527299; cv=none; d=zoho.com.cn; s=zohoarc; b=n1eBuVrwjc4BmFjdQ8ip9YJlxNNX8Mn8AwfRxi0ehJeOIRar5kM3BR5GKUIhyHwWcvN/GAungBOHZp9jGRFRplo3nApykVV/TJYs6EiWEWJDbxKtjtNRu1dG2B1xT7N7Dny5KeqcEFW890RXCSdzZc1SIwPj55NZE0hLfTOGHv8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1589527299; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=sq2MLgVY639o58c+VGRyEL7rhnnN3J1QbY59fuoMlZA=; b=YrYdQfaoTcUw0fyiY6zdB1nlCY+gjwiRacmfBbzQOxovEqS6VC10ID5PhRohYRVPzGnEhsdNomu3DAfY7keX1t5+SowOkGSmP/Q1B+gNL8WTlylSkdBdv1ZNmDrXDsH4BXkBOejZs4gP6uejCDzEMbKCQ5RlYZI+7Cn5qAeNfPQ= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=mykernel.net; spf=pass smtp.mailfrom=cgxu519@mykernel.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1589527299; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=From:To:Cc:Message-ID:Subject:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type; bh=sq2MLgVY639o58c+VGRyEL7rhnnN3J1QbY59fuoMlZA=; b=YWELHkijjMX4BMfx7qcLpquP2FvS+U+AT/iKrDMDZIJWLHvOS33/smHI+c1pH4/q EHUphyn0uR5TD3FZV7Ez7WA0IpH44zTnTkDTTYrSoJI5XbnkG6KrKGWa4EIxfrDvdBC Wj54stgAPxvPjVdgHfFuNWhiZ8TUtt8VdAS0S3gc= Received: from localhost.localdomain (218.18.229.179 [218.18.229.179]) by mx.zoho.com.cn with SMTPS id 1589527297143225.7718494253087; Fri, 15 May 2020 15:21:37 +0800 (CST) From: Chengguang Xu To: miklos@szeredi.hu, viro@zeniv.linux.org.uk, amir73il@gmail.com Cc: linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, Chengguang Xu Message-ID: <20200515072047.31454-2-cgxu519@mykernel.net> Subject: [RFC PATCH v3 1/9] fs/dcache: Introduce a new lookup flag LOOKUP_DONTCACHE_NEGATIVE Date: Fri, 15 May 2020 15:20:39 +0800 X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200515072047.31454-1-cgxu519@mykernel.net> References: <20200515072047.31454-1-cgxu519@mykernel.net> MIME-Version: 1.0 X-ZohoCNMailClient: External Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Introduce a new lookup flag LOOKUP_DONTCACHE_NEGATIVE to skip caching negative dentry in lookup. Signed-off-by: Chengguang Xu --- fs/namei.c | 14 ++++++++++---- include/linux/namei.h | 9 +++++++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index a320371899cf..a258f0a1d5d6 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1532,6 +1532,9 @@ static struct dentry *__lookup_slow(const struct qstr *name, if (unlikely(old)) { dput(dentry); dentry = old; + } else if ((flags & LOOKUP_DONTCACHE_NEGATIVE) && + d_is_negative(dentry)) { + d_drop(dentry); } } return dentry; @@ -2554,6 +2557,7 @@ EXPORT_SYMBOL(lookup_one_len); * @name: pathname component to lookup * @base: base directory to lookup from * @len: maximum length @len should be interpreted to + * @flags: lookup flags * * Note that this routine is purely a helper for filesystem usage and should * not be called by generic code. @@ -2562,7 +2566,8 @@ EXPORT_SYMBOL(lookup_one_len); * i_mutex held, and will take the i_mutex itself if necessary. */ struct dentry *lookup_one_len_unlocked(const char *name, - struct dentry *base, int len) + struct dentry *base, int len, + unsigned int flags) { struct qstr this; int err; @@ -2574,7 +2579,7 @@ struct dentry *lookup_one_len_unlocked(const char *name, ret = lookup_dcache(&this, base, 0); if (!ret) - ret = lookup_slow(&this, base, 0); + ret = lookup_slow(&this, base, flags); return ret; } EXPORT_SYMBOL(lookup_one_len_unlocked); @@ -2588,9 +2593,10 @@ EXPORT_SYMBOL(lookup_one_len_unlocked); * this one avoids such problems. */ struct dentry *lookup_positive_unlocked(const char *name, - struct dentry *base, int len) + struct dentry *base, int len, + unsigned int flags) { - struct dentry *ret = lookup_one_len_unlocked(name, base, len); + struct dentry *ret = lookup_one_len_unlocked(name, base, len, flags); if (!IS_ERR(ret) && d_flags_negative(smp_load_acquire(&ret->d_flags))) { dput(ret); ret = ERR_PTR(-ENOENT); diff --git a/include/linux/namei.h b/include/linux/namei.h index a4bb992623c4..1d43fc481e47 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h @@ -49,6 +49,9 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT}; /* LOOKUP_* flags which do scope-related checks based on the dirfd. */ #define LOOKUP_IS_SCOPED (LOOKUP_BENEATH | LOOKUP_IN_ROOT) +/* Hint: don't cache negative. */ +#define LOOKUP_DONTCACHE_NEGATIVE 0x200000 + extern int path_pts(struct path *path); extern int user_path_at_empty(int, const char __user *, unsigned, struct path *, int *empty); @@ -68,8 +71,10 @@ extern struct dentry *kern_path_locked(const char *, struct path *); extern struct dentry *try_lookup_one_len(const char *, struct dentry *, int); extern struct dentry *lookup_one_len(const char *, struct dentry *, int); -extern struct dentry *lookup_one_len_unlocked(const char *, struct dentry *, int); -extern struct dentry *lookup_positive_unlocked(const char *, struct dentry *, int); +extern struct dentry *lookup_one_len_unlocked(const char *name, + struct dentry *base, int len, unsigned int flags); +extern struct dentry *lookup_positive_unlocked(const char *name, + struct dentry *base, int len, unsigned int flags); extern int follow_down_one(struct path *); extern int follow_down(struct path *); From patchwork Fri May 15 07:20:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 11550683 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 87D80739 for ; Fri, 15 May 2020 07:37:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 715F120671 for ; Fri, 15 May 2020 07:37:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mykernel.net header.i=cgxu519@mykernel.net header.b="LVIrd5Z3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726730AbgEOHhl (ORCPT ); Fri, 15 May 2020 03:37:41 -0400 Received: from sender2-of-o52.zoho.com.cn ([163.53.93.247]:21141 "EHLO sender2-of-o52.zoho.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726714AbgEOHhk (ORCPT ); Fri, 15 May 2020 03:37:40 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1589527301; cv=none; d=zoho.com.cn; s=zohoarc; b=cOnPC6fo2pU/14DZwyXaDeYoiRUQrAxx2ja8b9431JEwsOUmKIEB5cjhUWGkN0hcrHPZ74+61N8TtRORNiJdRowI4cOTHZnElFaGR5xrGhuMSTGGgZ8vWucPL2Typg819PV3r2FTKaREPPnnMuFRXH0EQ+oeHp5F/U+SsaeOVfI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1589527301; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=N1RZID6HG/6fot9+I2ZQQxKOoFGvRFyHHKntpnHYIUc=; b=UiQLdbjsx7YGkV7qZpSk+5G7g+eMmR6L5at7jgAIsL3RRBy8t2fOGWYM++0gIw4fiOZuvyCiV3qrmwvCtg8okR+aQk3Kt8iWKJ2S1kGNWkezgzli/MpR99sPXc4qqyXvjl3A9sWJ4KkIZdCIooDgQgradw/N1j0GUmbBWvr0+MY= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=mykernel.net; spf=pass smtp.mailfrom=cgxu519@mykernel.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1589527301; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=From:To:Cc:Message-ID:Subject:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type; bh=N1RZID6HG/6fot9+I2ZQQxKOoFGvRFyHHKntpnHYIUc=; b=LVIrd5Z3Svfc1a42JPnvPQ6UpAxzM6ogujl6Hz3NoUx/hPROVhEbAwGcpnADjCcv RKxIi6z1E32txH18EZOc5P9E+DOKMxGO+eJSqF8AGZIJo5nbDBrwsmKI08VezUT/qys u8/KZTDujliEjX0Wj3/urkZEoKNbe0eIsOZeJKEU= Received: from localhost.localdomain (218.18.229.179 [218.18.229.179]) by mx.zoho.com.cn with SMTPS id 1589527298900169.1720668233885; Fri, 15 May 2020 15:21:38 +0800 (CST) From: Chengguang Xu To: miklos@szeredi.hu, viro@zeniv.linux.org.uk, amir73il@gmail.com Cc: linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, Chengguang Xu Message-ID: <20200515072047.31454-3-cgxu519@mykernel.net> Subject: [RFC PATCH v3 2/9] ovl: Suppress negative dentry in lookup Date: Fri, 15 May 2020 15:20:40 +0800 X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200515072047.31454-1-cgxu519@mykernel.net> References: <20200515072047.31454-1-cgxu519@mykernel.net> MIME-Version: 1.0 X-ZohoCNMailClient: External Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org In order to reduce useless negative dentries in upper/lower layers, specify LOOKUP_DONTCACHE_NEGATIVE flag in lookup so that we can drop negative dentries which generated in slow path of lookup. Signed-off-by: Chengguang Xu --- fs/overlayfs/namei.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index 0db23baf98e7..a400a7d126bd 100644 --- a/fs/overlayfs/namei.c +++ b/fs/overlayfs/namei.c @@ -200,7 +200,8 @@ static int ovl_lookup_single(struct dentry *base, struct ovl_lookup_data *d, int err; bool last_element = !post[0]; - this = lookup_positive_unlocked(name, base, namelen); + this = lookup_positive_unlocked(name, base, namelen, + LOOKUP_DONTCACHE_NEGATIVE); if (IS_ERR(this)) { err = PTR_ERR(this); this = NULL; @@ -657,7 +658,7 @@ struct dentry *ovl_get_index_fh(struct ovl_fs *ofs, struct ovl_fh *fh) if (err) return ERR_PTR(err); - index = lookup_positive_unlocked(name.name, ofs->indexdir, name.len); + index = lookup_positive_unlocked(name.name, ofs->indexdir, name.len, 0); kfree(name.name); if (IS_ERR(index)) { if (PTR_ERR(index) == -ENOENT) @@ -689,7 +690,7 @@ struct dentry *ovl_lookup_index(struct ovl_fs *ofs, struct dentry *upper, if (err) return ERR_PTR(err); - index = lookup_positive_unlocked(name.name, ofs->indexdir, name.len); + index = lookup_positive_unlocked(name.name, ofs->indexdir, name.len, 0); if (IS_ERR(index)) { err = PTR_ERR(index); if (err == -ENOENT) { @@ -1137,7 +1138,7 @@ bool ovl_lower_positive(struct dentry *dentry) struct dentry *lowerdir = poe->lowerstack[i].dentry; this = lookup_positive_unlocked(name->name, lowerdir, - name->len); + name->len, 0); if (IS_ERR(this)) { switch (PTR_ERR(this)) { case -ENOENT: From patchwork Fri May 15 07:20:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 11550673 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3A406697 for ; Fri, 15 May 2020 07:37:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 183972065C for ; Fri, 15 May 2020 07:37:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mykernel.net header.i=cgxu519@mykernel.net header.b="HSemMUGv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726716AbgEOHhe (ORCPT ); Fri, 15 May 2020 03:37:34 -0400 Received: from sender2-of-o52.zoho.com.cn ([163.53.93.247]:21143 "EHLO sender2-of-o52.zoho.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726613AbgEOHhe (ORCPT ); Fri, 15 May 2020 03:37:34 -0400 X-Greylist: delayed 908 seconds by postgrey-1.27 at vger.kernel.org; Fri, 15 May 2020 03:37:33 EDT ARC-Seal: i=1; a=rsa-sha256; t=1589527302; cv=none; d=zoho.com.cn; s=zohoarc; b=d/xfKEn+tR/7bR8nS9hg0WFG6dB4vhN1NLn5YBaZVDbJy1bPm+W/Yp6OrAf2RjtiUM3ocz38NSvUktOMBN4xE+WOtgAjm9wa6Fb0WrV+hVpG3RWzj/aXQt9p0iRD/L8bZ66OaQ+baB5ZNIjDZk75Pjiqp7FCLxfNvMP02zMO5u4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1589527302; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=OQfSZ7V3N57McV37KTNRAC36myQ0WuVNtBUJ3+y8HO4=; b=UIMWsSf6OAa71bG0z8hqOjC+aArdxWyxkH+t/6oyrKFuO7WRt/w4ukjftyZdp4o0Rk1UZvL26inlkbhyDFDnyqpw4Mqjmgue1DLuxGlRiHiCyRDAuw+5aPt2qHZB5pAApAtlhxmr/DmjeZthyFb7RFDZkPggR8UPBtLTr6fb78Y= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=mykernel.net; spf=pass smtp.mailfrom=cgxu519@mykernel.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1589527302; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=From:To:Cc:Message-ID:Subject:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type; bh=OQfSZ7V3N57McV37KTNRAC36myQ0WuVNtBUJ3+y8HO4=; b=HSemMUGvIrr4LrvfQKG9MgyYUYYLF1ugok4ymMy6Ljsk6koX5t0fBqvwP8Q8Uk0h PGzOBmHd2hR+6R21akkNwXfJA624xZgcyX8SNam6G3aZLepSpt5iFXyI0VEZCRbUM7p qP+REAq4zrShXvUC52Oe33C7MWVfYUhUZtKqAQ/8= Received: from localhost.localdomain (218.18.229.179 [218.18.229.179]) by mx.zoho.com.cn with SMTPS id 1589527301388870.0795917521274; Fri, 15 May 2020 15:21:41 +0800 (CST) From: Chengguang Xu To: miklos@szeredi.hu, viro@zeniv.linux.org.uk, amir73il@gmail.com Cc: linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, Chengguang Xu Message-ID: <20200515072047.31454-4-cgxu519@mykernel.net> Subject: [RFC PATCH v3 3/9] cifs: Adjust argument for lookup_positive_unlocked() Date: Fri, 15 May 2020 15:20:41 +0800 X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200515072047.31454-1-cgxu519@mykernel.net> References: <20200515072047.31454-1-cgxu519@mykernel.net> MIME-Version: 1.0 X-ZohoCNMailClient: External Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Set 0 as lookup flag argument when calling lookup_positive_unlocked(), because we don't hope to drop negative dentry in lookup. Signed-off-by: Chengguang Xu --- fs/cifs/cifsfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index c31f362fa098..e52a3b35ebac 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -752,7 +752,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb) while (*s && *s != sep) s++; - child = lookup_positive_unlocked(p, dentry, s - p); + child = lookup_positive_unlocked(p, dentry, s - p, 0); dput(dentry); dentry = child; } while (!IS_ERR(dentry)); From patchwork Fri May 15 07:20:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 11550681 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8A559739 for ; Fri, 15 May 2020 07:37:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 68A8120671 for ; Fri, 15 May 2020 07:37:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mykernel.net header.i=cgxu519@mykernel.net header.b="K7a2novI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726729AbgEOHhj (ORCPT ); Fri, 15 May 2020 03:37:39 -0400 Received: from sender2-of-o52.zoho.com.cn ([163.53.93.247]:21122 "EHLO sender2-of-o52.zoho.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726711AbgEOHhh (ORCPT ); Fri, 15 May 2020 03:37:37 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1589527305; cv=none; d=zoho.com.cn; s=zohoarc; b=MrnTR8zGCASQF9RDnWUIp17kLCy0mOnKPbvfEe7L7dGUBAd1AsY5oB4VEbtm39ZOcEhfPoENbSHBsTizfc1HvESnQj0KayULB9JY7Z6GEiW1X2wjd4okAGjsVx0YDN5c3HMyMPhdjylcplxEh5FtoQwohx5F8k5x1Ru/o3t3cK4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1589527305; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=QI2uO+6qInvA6nTOODT6EV5/ob+2kzYLGLBF57B3AHs=; b=FQjnL0r1JP09LVUG6+it7bu52E+QeaFX6FZ0C3bIeBzumeat2IB+rBWJlXOBcNv4MsPJpo5xgw0SGsajBI2SEN2t33CV11Z6TmmoVkwj7gauqWI/oKJ7RNn2E+XCsixrdYDPcA3bOtbz9qQ1MpIeM2vv5uNUW3qU26gqss6qL90= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=mykernel.net; spf=pass smtp.mailfrom=cgxu519@mykernel.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1589527305; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=From:To:Cc:Message-ID:Subject:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type; bh=QI2uO+6qInvA6nTOODT6EV5/ob+2kzYLGLBF57B3AHs=; b=K7a2novINPl1o21KQcrX1Ap/1rD7egdzg8PObF2wh7l0ttSkSJ+cQaQOQdTbC6Gh mpdMg6Ld28/zvTSXhUZ88oDYbXLft89sBpINTlyvDoP3Cu3etJiTKbP+UNUJys5vGS9 PTPHeaXyX5fkAkJTF+w8MgdViZnpg/YjCXq64y+o= Received: from localhost.localdomain (218.18.229.179 [218.18.229.179]) by mx.zoho.com.cn with SMTPS id 1589527302790519.7614667820507; Fri, 15 May 2020 15:21:42 +0800 (CST) From: Chengguang Xu To: miklos@szeredi.hu, viro@zeniv.linux.org.uk, amir73il@gmail.com Cc: linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, Chengguang Xu Message-ID: <20200515072047.31454-5-cgxu519@mykernel.net> Subject: [RFC PATCH v3 4/9] debugfs: Adjust argument for lookup_positive_unlocked() Date: Fri, 15 May 2020 15:20:42 +0800 X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200515072047.31454-1-cgxu519@mykernel.net> References: <20200515072047.31454-1-cgxu519@mykernel.net> MIME-Version: 1.0 X-ZohoCNMailClient: External Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Set 0 as lookup flag argument when calling lookup_positive_unlocked(), because we don't hope to drop negative dentry in lookup. Signed-off-by: Chengguang Xu --- fs/debugfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index b7f2e971ecbc..df4f37a6a9ab 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c @@ -299,7 +299,7 @@ struct dentry *debugfs_lookup(const char *name, struct dentry *parent) if (!parent) parent = debugfs_mount->mnt_root; - dentry = lookup_positive_unlocked(name, parent, strlen(name)); + dentry = lookup_positive_unlocked(name, parent, strlen(name), 0); if (IS_ERR(dentry)) return NULL; return dentry; From patchwork Fri May 15 07:20:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 11550689 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BF913739 for ; Fri, 15 May 2020 07:37:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9DFE320671 for ; Fri, 15 May 2020 07:37:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mykernel.net header.i=cgxu519@mykernel.net header.b="PWRCpzl8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726821AbgEOHhr (ORCPT ); Fri, 15 May 2020 03:37:47 -0400 Received: from sender2-of-o52.zoho.com.cn ([163.53.93.247]:21146 "EHLO sender2-of-o52.zoho.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726714AbgEOHhp (ORCPT ); Fri, 15 May 2020 03:37:45 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1589527305; cv=none; d=zoho.com.cn; s=zohoarc; b=YM4hnMpOZ7PQIQyp3EpriEIqiWBDiUP0cjsNmmxMaz9f3jPnDv2JyIzPzBa70RtHMR1eAfLwNJz62X9Id1KZmScAsUc/62DCFFkM0jY+a2nM0E8IIvlQpKMkMnaRaKY8WikJRxwlTnGMkoyKCRtGEvnwn2iLbhD94OHUyyqZ4fQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1589527305; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=olns2XfB6tJoDBwJH0OMezwkXtbEgUdzY7HgpQ0/JL8=; b=qR86ijZ4nr30BK+mm9k4FCQL+eslMkPqJHjXXWOJBCPMqNSQBks04P6WwRrmSgdZRnbdjM4xnJFO0NLJQ5kbva2p0LpEXmW279GtDgtOtSu7gaVaWxM6/LVIf6peRaSzAdkCWsf2eLORM29RErfoQHbOtclFUAeYUr/9syOZzfQ= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=mykernel.net; spf=pass smtp.mailfrom=cgxu519@mykernel.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1589527305; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=From:To:Cc:Message-ID:Subject:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type; bh=olns2XfB6tJoDBwJH0OMezwkXtbEgUdzY7HgpQ0/JL8=; b=PWRCpzl809CyJmy6RUlijxQpelqmPydPDev/eOZAom/iRY0RUlaxBVWnvE+9wipP KmKqhU0pW75/6mPaO76RPZFuuewqTzvh21gjzbWOLVB3a9BAcvkfHgtq7EcnWTLYBcC M6/N7ODErN6i6NaLfio2k/FoC3DhvsGsIYxnlvPA= Received: from localhost.localdomain (218.18.229.179 [218.18.229.179]) by mx.zoho.com.cn with SMTPS id 1589527304133785.5848804527277; Fri, 15 May 2020 15:21:44 +0800 (CST) From: Chengguang Xu To: miklos@szeredi.hu, viro@zeniv.linux.org.uk, amir73il@gmail.com Cc: linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, Chengguang Xu Message-ID: <20200515072047.31454-6-cgxu519@mykernel.net> Subject: [RFC PATCH v3 5/9] ecryptfs: Adjust argument for lookup_one_len_unlocked() Date: Fri, 15 May 2020 15:20:43 +0800 X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200515072047.31454-1-cgxu519@mykernel.net> References: <20200515072047.31454-1-cgxu519@mykernel.net> MIME-Version: 1.0 X-ZohoCNMailClient: External Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Set 0 as lookup flag argument when calling lookup_one_len_unlocked(), because we don't hope to drop negative dentry in lookup. Signed-off-by: Chengguang Xu --- fs/ecryptfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index e23752d9a79f..e39af6313ad9 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c @@ -407,7 +407,7 @@ static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode, name = encrypted_and_encoded_name; } - lower_dentry = lookup_one_len_unlocked(name, lower_dir_dentry, len); + lower_dentry = lookup_one_len_unlocked(name, lower_dir_dentry, len, 0); if (IS_ERR(lower_dentry)) { ecryptfs_printk(KERN_DEBUG, "%s: lookup_one_len() returned " "[%ld] on lower_dentry = [%s]\n", __func__, From patchwork Fri May 15 07:20:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 11550671 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 382D1697 for ; Fri, 15 May 2020 07:37:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CF1AA206F4 for ; Fri, 15 May 2020 07:37:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mykernel.net header.i=cgxu519@mykernel.net header.b="PTAJ0cLC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726708AbgEOHhe (ORCPT ); Fri, 15 May 2020 03:37:34 -0400 Received: from sender2-of-o52.zoho.com.cn ([163.53.93.247]:21144 "EHLO sender2-of-o52.zoho.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726700AbgEOHhd (ORCPT ); Fri, 15 May 2020 03:37:33 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1589527308; cv=none; d=zoho.com.cn; s=zohoarc; b=VEVPQNJHmPE+IJH3RZxNtSjHz/BcKhJX/UW4+FOOLLMLz7P3W/Q4dncVIDv8gkCLybwwu8IV35Vio+4q4Tx3ybwcl9bMpxK6HMevWRxEdvmU10wpri+eSFEUONc5aiYly2mfM8rRtItUlx+ewVPy1y2sg2jt/HI7w2sQiWW9rlY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1589527308; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=qj5ywJSYyyAOPGei8sj6RzN+Jthoxsxu6NPYdhbNiuE=; b=jAZ+/u3xid/9EkVQ+7TW9cpdbWLpoWm/5e4Sk3xwCiM4xdDLSZXEckXHngEnujNC/kko9E2EjOV2lj1Jiq17zlCmvCcs1d0ggjaHhaali0cXbcTNQU9hxNpncX/eX09HAEF8XyxJeenvOpqOZPd9ny7tQutX/DbnkXcA528jyIc= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=mykernel.net; spf=pass smtp.mailfrom=cgxu519@mykernel.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1589527308; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=From:To:Cc:Message-ID:Subject:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type; bh=qj5ywJSYyyAOPGei8sj6RzN+Jthoxsxu6NPYdhbNiuE=; b=PTAJ0cLCqFOFl0j0Gy05cneIACDAAigfS3jG2c30GGtItDIPQ8Ya6tbolJPbbbGP z1caDL8LeGn8n/NqRFmexWOCa07oag2rKJzsYbp499fd8iliRCURo0Xb1cM38ZScKjl LHzhexyYAXTdgKIYXKavC6zcahdREBAD4und3tVU= Received: from localhost.localdomain (218.18.229.179 [218.18.229.179]) by mx.zoho.com.cn with SMTPS id 1589527305512510.623272626652; Fri, 15 May 2020 15:21:45 +0800 (CST) From: Chengguang Xu To: miklos@szeredi.hu, viro@zeniv.linux.org.uk, amir73il@gmail.com Cc: linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, Chengguang Xu Message-ID: <20200515072047.31454-7-cgxu519@mykernel.net> Subject: [RFC PATCH v3 6/9] exportfs: Adjust argument for lookup_one_len_unlocked() Date: Fri, 15 May 2020 15:20:44 +0800 X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200515072047.31454-1-cgxu519@mykernel.net> References: <20200515072047.31454-1-cgxu519@mykernel.net> MIME-Version: 1.0 X-ZohoCNMailClient: External Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Set 0 as lookup flag argument when calling lookup_one_len_unlocked(), because we don't hope to drop negative dentry in lookup. Signed-off-by: Chengguang Xu --- fs/exportfs/expfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c index 2dd55b172d57..a4276d14aebb 100644 --- a/fs/exportfs/expfs.c +++ b/fs/exportfs/expfs.c @@ -145,7 +145,7 @@ static struct dentry *reconnect_one(struct vfsmount *mnt, if (err) goto out_err; dprintk("%s: found name: %s\n", __func__, nbuf); - tmp = lookup_one_len_unlocked(nbuf, parent, strlen(nbuf)); + tmp = lookup_one_len_unlocked(nbuf, parent, strlen(nbuf), 0); if (IS_ERR(tmp)) { dprintk("%s: lookup failed: %d\n", __func__, PTR_ERR(tmp)); err = PTR_ERR(tmp); From patchwork Fri May 15 07:20:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 11550675 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DB543739 for ; Fri, 15 May 2020 07:37:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA35C206F4 for ; Fri, 15 May 2020 07:37:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mykernel.net header.i=cgxu519@mykernel.net header.b="ED37Aywm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726728AbgEOHhj (ORCPT ); Fri, 15 May 2020 03:37:39 -0400 Received: from sender2-of-o52.zoho.com.cn ([163.53.93.247]:21145 "EHLO sender2-of-o52.zoho.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726715AbgEOHhh (ORCPT ); Fri, 15 May 2020 03:37:37 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1589527309; cv=none; d=zoho.com.cn; s=zohoarc; b=ipnm8/fT9xfvgU32eK3enUxfv51FtuGieLits0tW1hs0QDvi0+/Gr56Sf9bhAkIT1ND+ZnvvMWZaOqCUXMGE/4MKzul+kn3MLNhYV2bgQQ57kVaoOk1tIhI80jF4y6dEfW+nndUBF9xjZ5LTuXvl2oJK1M6ZrRZ8S2QPOxL9QXw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1589527309; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=/zcjwUOZSvHEU5HoCVl0NjoEfg5VSqwCmmFmmBKUM6w=; b=RnSnIEETkAF6q1mlR4euULZQUa78Cm0mx0g8wCn4mzdWu1CaCVLZMRbY2B9Rxa4BnaMEbAbgrYiRPD/SFD7LnvMHuyAjlSM/I37kKYPR3zYB8wXngSO17c7k3L0Uz+UeZpjEBNUKvjUbnhshKaerWyB/iFqBwSS6HSYiYq7RNjo= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=mykernel.net; spf=pass smtp.mailfrom=cgxu519@mykernel.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1589527309; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=From:To:Cc:Message-ID:Subject:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type; bh=/zcjwUOZSvHEU5HoCVl0NjoEfg5VSqwCmmFmmBKUM6w=; b=ED37Aywmz3hf7x4KDbLYGuS/ahKrdfTpnKku+vMpyMz6HPwGABdHuWzabzcK8NKo Z3peuW/nYgI4R82luUG7skJkKeYNJ4Jj/QJ/t1/u0ZCY5TQNUgSxVn3Zm4jWfN61wXh 5lF5a5LsWMOpHLuGYujqpijpRwP/db8wom6Khv4Q= Received: from localhost.localdomain (218.18.229.179 [218.18.229.179]) by mx.zoho.com.cn with SMTPS id 1589527306843634.123449457146; Fri, 15 May 2020 15:21:46 +0800 (CST) From: Chengguang Xu To: miklos@szeredi.hu, viro@zeniv.linux.org.uk, amir73il@gmail.com Cc: linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, Chengguang Xu Message-ID: <20200515072047.31454-8-cgxu519@mykernel.net> Subject: [RFC PATCH v3 7/9] kernfs: Adjust argument for lookup_positive_unlocked() Date: Fri, 15 May 2020 15:20:45 +0800 X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200515072047.31454-1-cgxu519@mykernel.net> References: <20200515072047.31454-1-cgxu519@mykernel.net> MIME-Version: 1.0 X-ZohoCNMailClient: External Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Set 0 as lookup flag argument when calling lookup_positive_unlocked(), because we don't hope to drop negative dentry in lookup. Signed-off-by: Chengguang Xu --- fs/kernfs/mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/kernfs/mount.c b/fs/kernfs/mount.c index 9dc7e7a64e10..3162d2bf39b3 100644 --- a/fs/kernfs/mount.c +++ b/fs/kernfs/mount.c @@ -224,7 +224,7 @@ struct dentry *kernfs_node_dentry(struct kernfs_node *kn, return ERR_PTR(-EINVAL); } dtmp = lookup_positive_unlocked(kntmp->name, dentry, - strlen(kntmp->name)); + strlen(kntmp->name), 0); dput(dentry); if (IS_ERR(dtmp)) return dtmp; From patchwork Fri May 15 07:20:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 11550677 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5070114C0 for ; Fri, 15 May 2020 07:37:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3920520671 for ; Fri, 15 May 2020 07:37:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mykernel.net header.i=cgxu519@mykernel.net header.b="f1Qk7bXE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726731AbgEOHhj (ORCPT ); Fri, 15 May 2020 03:37:39 -0400 Received: from sender2-of-o52.zoho.com.cn ([163.53.93.247]:21123 "EHLO sender2-of-o52.zoho.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726719AbgEOHhi (ORCPT ); Fri, 15 May 2020 03:37:38 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1589527309; cv=none; d=zoho.com.cn; s=zohoarc; b=M5K+BuRevkxWk+9xVFPjbZNn3Lw9uhohWcsjcsYR1VAMx6xfeQha9dwKT+v9AkN0MCKTW0dwoBq+/L8lLL+n99TvMtcv83fByijkPJpTFKg+F2u8JBk8DaXm8HRbvLQsoLQeqx3JYerH5miX+2qigIxvYrXXPUaIIS9s6gjnCfA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1589527309; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=uQ0EXwR2Al/tb5JmEvZvWIhJKgUaG+C2+JJVMkI3umI=; b=g5AM3ZYhObqYjc1RxZaiveSHWm6hIN2cUz0EqtHxiyljG2keJMFldR+LtzFz9atAKAIYyc2jspayvSIPwxXoFXBCdoPSbzCd6YaQdLcOKUNVDN7XUyOYs0vDaQwbK7o7zrnicv6/P6/RWb3NarJemO2o7NT5wPCQTtIRZ7WNnYs= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=mykernel.net; spf=pass smtp.mailfrom=cgxu519@mykernel.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1589527309; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=From:To:Cc:Message-ID:Subject:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type; bh=uQ0EXwR2Al/tb5JmEvZvWIhJKgUaG+C2+JJVMkI3umI=; b=f1Qk7bXE2uKwlimVK0HWv2UdBO0dknUjm4MGlYca2EC4CUjkU34M49U1No6Yzg6F Kt3oZcLuLMfTeM3KXu1B5wK3vAJgHQpJNNTzUkFrA3fjw3bSqiqOmSydYzp4FRgdalJ Y8J4Mwqla1TeRLN0GHtkWgK0wDvjpMexuGQVY37o= Received: from localhost.localdomain (218.18.229.179 [218.18.229.179]) by mx.zoho.com.cn with SMTPS id 1589527308239833.498669537171; Fri, 15 May 2020 15:21:48 +0800 (CST) From: Chengguang Xu To: miklos@szeredi.hu, viro@zeniv.linux.org.uk, amir73il@gmail.com Cc: linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, Chengguang Xu Message-ID: <20200515072047.31454-9-cgxu519@mykernel.net> Subject: [RFC PATCH v3 8/9] nfsd: Adjust argument for lookup_positive_unlocked() Date: Fri, 15 May 2020 15:20:46 +0800 X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200515072047.31454-1-cgxu519@mykernel.net> References: <20200515072047.31454-1-cgxu519@mykernel.net> MIME-Version: 1.0 X-ZohoCNMailClient: External Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Set 0 as lookup flag argument when calling lookup_positive_unlocked(), because we don't hope to drop negative dentry in lookup. Signed-off-by: Chengguang Xu --- fs/nfsd/nfs3xdr.c | 2 +- fs/nfsd/nfs4xdr.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c index aae514d40b64..19628922969c 100644 --- a/fs/nfsd/nfs3xdr.c +++ b/fs/nfsd/nfs3xdr.c @@ -855,7 +855,7 @@ compose_entry_fh(struct nfsd3_readdirres *cd, struct svc_fh *fhp, } else dchild = dget(dparent); } else - dchild = lookup_positive_unlocked(name, dparent, namlen); + dchild = lookup_positive_unlocked(name, dparent, namlen, 0); if (IS_ERR(dchild)) return rv; if (d_mountpoint(dchild)) diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 996ac01ee977..1a69e60b8d59 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -3066,7 +3066,8 @@ nfsd4_encode_dirent_fattr(struct xdr_stream *xdr, struct nfsd4_readdir *cd, __be32 nfserr; int ignore_crossmnt = 0; - dentry = lookup_positive_unlocked(name, cd->rd_fhp->fh_dentry, namlen); + dentry = lookup_positive_unlocked(name, cd->rd_fhp->fh_dentry, + namlen, 0); if (IS_ERR(dentry)) return nfserrno(PTR_ERR(dentry)); From patchwork Fri May 15 07:20:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 11550685 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D008B697 for ; Fri, 15 May 2020 07:37:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ACFD52065C for ; Fri, 15 May 2020 07:37:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mykernel.net header.i=cgxu519@mykernel.net header.b="DUvQrPgV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726786AbgEOHhp (ORCPT ); Fri, 15 May 2020 03:37:45 -0400 Received: from sender2-of-o52.zoho.com.cn ([163.53.93.247]:21140 "EHLO sender2-of-o52.zoho.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726718AbgEOHhm (ORCPT ); Fri, 15 May 2020 03:37:42 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1589527312; cv=none; d=zoho.com.cn; s=zohoarc; b=maG4CChuV70ufvyzozEvm1K24WH8QAe0i7s8MDgKz+Oo9fWFNPDpT0a4dR/YxH99FrmMApoF9ke7yi4WM1Mz0+01M1X75v45dh2oKxI86A0vzKsg+ojG8VVr61yoQ0tleeMBBVMSTSchf6U+oFnyuR/bsaOxuGSvK5k/Ggj3WG0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1589527312; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=xUFcLyWr4D8q4EQRC/9G8D3ERMkZBUzlZqLURVLHOP8=; b=n8ZIefAncCbit8tq8y7jyrsnBvFMlCdAn9VBaxt7x6Wp0bcNIrnk/dqBNnOPBWaI+1kne9TZotSTVTdNlXol++2cVw9AaSIGM6jSlyQeLohkRwfSMDp5iXTSEgQgsrx6PzkX4T4eqJxofE1mTrkfbWwJYMwC467cqHJkzMRfCQQ= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=mykernel.net; spf=pass smtp.mailfrom=cgxu519@mykernel.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1589527312; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=From:To:Cc:Message-ID:Subject:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type; bh=xUFcLyWr4D8q4EQRC/9G8D3ERMkZBUzlZqLURVLHOP8=; b=DUvQrPgVk+bvT+BlHUbjK6vPj3wVxyTBBisJOVMT9sNr0ubRuvSuaVkC6CataIkN tOBtYsquB8fTmn615t2ZZ9ddCL+yJqWVP7qRLY24Jew1GfQ7naqLQlMSSja9qZwltzW wIkBScdk7Du+SKygRCfkuyDle4iAEz4YlFBj7R6E= Received: from localhost.localdomain (218.18.229.179 [218.18.229.179]) by mx.zoho.com.cn with SMTPS id 1589527309583206.8447354867062; Fri, 15 May 2020 15:21:49 +0800 (CST) From: Chengguang Xu To: miklos@szeredi.hu, viro@zeniv.linux.org.uk, amir73il@gmail.com Cc: linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, Chengguang Xu Message-ID: <20200515072047.31454-10-cgxu519@mykernel.net> Subject: [RFC PATCH v3 9/9] quota: Adjust argument for lookup_positive_unlocked() Date: Fri, 15 May 2020 15:20:47 +0800 X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200515072047.31454-1-cgxu519@mykernel.net> References: <20200515072047.31454-1-cgxu519@mykernel.net> MIME-Version: 1.0 X-ZohoCNMailClient: External Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Set 0 as lookup flag argument when calling lookup_positive_unlocked(), because we don't hope to drop negative dentry in lookup. Signed-off-by: Chengguang Xu --- fs/quota/dquot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index b6a4f692d345..8d6c32f75a4d 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -2488,7 +2488,8 @@ int dquot_quota_on_mount(struct super_block *sb, char *qf_name, struct dentry *dentry; int error; - dentry = lookup_positive_unlocked(qf_name, sb->s_root, strlen(qf_name)); + dentry = lookup_positive_unlocked(qf_name, sb->s_root, + strlen(qf_name), 0); if (IS_ERR(dentry)) return PTR_ERR(dentry);