From patchwork Wed Nov 29 20:35:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10083567 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 417086020B for ; Wed, 29 Nov 2017 20:37:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3447629BC8 for ; Wed, 29 Nov 2017 20:37:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 296B829BFD; Wed, 29 Nov 2017 20:37:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5B9329BC8 for ; Wed, 29 Nov 2017 20:37:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752767AbdK2UhG (ORCPT ); Wed, 29 Nov 2017 15:37:06 -0500 Received: from mail-it0-f68.google.com ([209.85.214.68]:43980 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752416AbdK2Ugx (ORCPT ); Wed, 29 Nov 2017 15:36:53 -0500 Received: by mail-it0-f68.google.com with SMTP id u62so5627162ita.2 for ; Wed, 29 Nov 2017 12:36:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/2pLABOucLEddYpxGmw90X4j6hUQn88cc/yPAP80ZhQ=; b=ht34M/eBHSCFKNeLUpYu4ZwuS+aoPZ2dFJ37lr/2EDDTMHtwjdEMXdzYj9ibaIw7q7 mBWZdsZ/gRvh2EY/wFrgrnpc3kzmGfrJT6dm5bXy/kK10xv53kv//uSsuIfa2sieAZOK /WY/n1QPFPMUfiwfw5duzcgt6i02lsjiqVdf6z9kAzXCjSyAZH9RhSwICLGwBheF1v3d D7zcF9NSDueMZEkKLBXIL5F9fu2e1dugFZVYWT00am8tx7XRyPcV7R0D/nVW0guqSbiX 7QqxcwXPQov4P2UEqDNm5qIPeYnoDA90w7O9w5ZGNzHx4NrBS9KZ1h3EFaFGnVNHmpSm xJEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/2pLABOucLEddYpxGmw90X4j6hUQn88cc/yPAP80ZhQ=; b=ERIWQu+xOdU/vHFSh9Ix3oJ+spoA2A/uWrVbqWtNrsE/Ch2uzDkOWOnQsA/6bM7RW3 NAfUjkCkTCGaCohyHvLFAuU3mkkEgrrbuIcY6AT5KvUXiO+V+N4znApzcCtO7LzVxnVc VHXCVoBUiwO4qsl/+w4hnZkgYVcAQKq0kMMPb8bxmr3F3CpZa/fWHh+GkWbIqZLbFlVe qmrNaf14s7sV2nJ4Pfjz/E4EDAiVudjCKu6r7lCdy84rRuugoIBo0dvAI8firSCNfKm6 BYdlXIAP4RMmEb4/hiYERqUA9afl3DbBJoXLmizpMxlBsg3ePr3iXrQbAYZNGr8mhyxc 29Ig== X-Gm-Message-State: AJaThX5UyZ+7sbPHlKeTP8apDFQVxiUv1QLHIMibX4wUVzpD4t1XHqRe FTEuxDKw7IVfBsc/c7kYHEw= X-Google-Smtp-Source: AGs4zMaSpHiT3JkGtbGLrZG3Bri2aGEQZOlDspufEPanYqiLZpIon/e+95+1d4XPVedhvq2EcPyQhg== X-Received: by 10.36.115.133 with SMTP id y127mr86224itb.83.1511987813047; Wed, 29 Nov 2017 12:36:53 -0800 (PST) Received: from ebiggers-linuxstation.kir.corp.google.com ([100.66.175.88]) by smtp.gmail.com with ESMTPSA id 15sm1149652ioj.80.2017.11.29.12.36.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Nov 2017 12:36:52 -0800 (PST) From: Eric Biggers To: linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim , Chao Yu , linux-fscrypt@vger.kernel.org, Eric Biggers Subject: [PATCH v2 2/5] f2fs: switch to fscrypt_prepare_link() Date: Wed, 29 Nov 2017 12:35:29 -0800 Message-Id: <20171129203532.87729-3-ebiggers3@gmail.com> X-Mailer: git-send-email 2.15.0.531.g2ccb3012c9-goog In-Reply-To: <20171129203532.87729-1-ebiggers3@gmail.com> References: <20171129203532.87729-1-ebiggers3@gmail.com> Sender: linux-fscrypt-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fscrypt@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers Reviewed-by: Chao Yu Signed-off-by: Eric Biggers --- fs/f2fs/namei.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 28bdf8828e73..dcf5c3a97059 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -240,9 +240,9 @@ static int f2fs_link(struct dentry *old_dentry, struct inode *dir, if (unlikely(f2fs_cp_error(sbi))) return -EIO; - if (f2fs_encrypted_inode(dir) && - !fscrypt_has_permitted_context(dir, inode)) - return -EPERM; + err = fscrypt_prepare_link(old_dentry, dir, dentry); + if (err) + return err; if (is_inode_flag_set(dir, FI_PROJ_INHERIT) && (!projid_eq(F2FS_I(dir)->i_projid,