Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp4022339imc; Thu, 14 Mar 2019 10:24:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqydhSdv/JqM3qMJSvXB5i0DN5srbNyPpOJRTFAbLUPgCHeFJxVCQx3AS6E8kzpXFekF3DR4 X-Received: by 2002:a62:1ac3:: with SMTP id a186mr50433891pfa.48.1552584284526; Thu, 14 Mar 2019 10:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552584284; cv=none; d=google.com; s=arc-20160816; b=VYO5JPbRaZwLMrii2OEblvwO+GBWdD87hlEAA8VOciIMnEw+kSBaSku/BSf5g1Q3Vc 5AdVIP3W2J8gJrsvaTqgyAl9gDZInXcwt95v5mXwVPb2tiFlTxS762ddYEyNrUaxe0SJ EkFyk2HerGHPiTYzu7mQCyKfu2LgMaCw6SMSSSFZ2EP+cmmHTtg3a4tMkxMeK4wzS4Kg AotrQKgqhjcixIt20JKOu07D90KiL7+H10lJge0aOAWE8hekqgFhC8rrmYW7wkdsevNP qfO311eZ38dbdBUupKvoEVRp88S5eeKOZHsmUxTDUeJwxlgLCIo6rP4Cja6aPJfRadrU P7QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ECK47KWB9/pl5yG2rNwv0I+xbYUfHu7jjf0JMvg3XbA=; b=Zq31I6jHWRDbUVXGgVwGsg9r3XKCLTlaj6gyUpDfrpQsov6ou7JtxeD4BB21tb+F5O 5+0QjPI0wG99kWs5f2RzUnK1b8Cv7DZes0hahhuDjqzUWcAI0nKVx6U+pC6oQ1T2Cm1+ tMX//nINb7/G3hXEVAZ+h8srShuswouCZgAvyaimB8usvs8FSivKg1kjhN1UKHs4CADE dz/YrkVLQTevLsalIQdo9K1lnGZZTYf+0Pe6ESqTQ1N6VJ9WI8Kx7ZyNBL7Lwm0LCW+4 6ok2hCujwOBoUQO9gZU8NDOE7CvB30UVUdIN37sY10lWX8H3svVJmLrFDu7pXwEdgIFU x+XQ== 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 x6si13043863pge.211.2019.03.14.10.24.29; Thu, 14 Mar 2019 10:24:44 -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 S1727279AbfCNRXO (ORCPT + 99 others); Thu, 14 Mar 2019 13:23:14 -0400 Received: from lilium.sigma-star.at ([109.75.188.150]:53164 "EHLO lilium.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726157AbfCNRXN (ORCPT ); Thu, 14 Mar 2019 13:23:13 -0400 X-Greylist: delayed 418 seconds by postgrey-1.27 at vger.kernel.org; Thu, 14 Mar 2019 13:23:12 EDT Received: from localhost (localhost [127.0.0.1]) by lilium.sigma-star.at (Postfix) with ESMTP id A4EC818013763; Thu, 14 Mar 2019 18:16:20 +0100 (CET) From: Richard Weinberger To: linux-mtd@lists.infradead.org Cc: linux-fscrypt@vger.kernel.org, jaegeuk@kernel.org, tytso@mit.edu, linux-unionfs@vger.kernel.org, miklos@szeredi.hu, amir73il@gmail.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, paullawrence@google.com, Richard Weinberger Subject: [PATCH 1/4] fscrypt: Implement FS_CFLG_OWN_D_OPS Date: Thu, 14 Mar 2019 18:15:56 +0100 Message-Id: <20190314171559.27584-2-richard@nod.at> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190314171559.27584-1-richard@nod.at> References: <20190314171559.27584-1-richard@nod.at> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If a filesystem sets FS_CFLG_OWN_D_OPS it manages dentry operations itself and fscrypt is not allowed to set them. Signed-off-by: Richard Weinberger --- fs/crypto/hooks.c | 4 +++- include/linux/fscrypt.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/crypto/hooks.c b/fs/crypto/hooks.c index 56debb1fcf5e..3ec925405fbe 100644 --- a/fs/crypto/hooks.c +++ b/fs/crypto/hooks.c @@ -107,7 +107,9 @@ int __fscrypt_prepare_lookup(struct inode *dir, struc= t dentry *dentry) spin_unlock(&dentry->d_lock); } =20 - d_set_d_op(dentry, &fscrypt_d_ops); + if ((dir->i_sb->s_cop->flags & FS_CFLG_OWN_D_OPS) =3D=3D 0) + d_set_d_op(dentry, &fscrypt_d_ops); + return 0; } EXPORT_SYMBOL_GPL(__fscrypt_prepare_lookup); diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h index e5194fc3983e..7139a110ac4f 100644 --- a/include/linux/fscrypt.h +++ b/include/linux/fscrypt.h @@ -48,6 +48,7 @@ struct fscrypt_name { * fscrypt superblock flags */ #define FS_CFLG_OWN_PAGES (1U << 1) +#define FS_CFLG_OWN_D_OPS (1U << 2) =20 /* * crypto operations for filesystems --=20 2.21.0