From patchwork Wed Nov 29 20:43:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10083579 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 F212A6020B for ; Wed, 29 Nov 2017 20:44:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E50C029C15 for ; Wed, 29 Nov 2017 20:44:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9CA729C19; Wed, 29 Nov 2017 20:44:18 +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 90BC429C17 for ; Wed, 29 Nov 2017 20:44:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752558AbdK2UoS (ORCPT ); Wed, 29 Nov 2017 15:44:18 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:35029 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752361AbdK2UoR (ORCPT ); Wed, 29 Nov 2017 15:44:17 -0500 Received: by mail-it0-f65.google.com with SMTP id f143so5802355itb.0 for ; Wed, 29 Nov 2017 12:44:17 -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=DC1Spcz6XibfSD3gTEIjLDTxs+1j3zVr9HN12XxNxNk=; b=ftfN+AnE+pyLzcrCnLkiLAv4G6nFeD15o+pi/tZIKkkvsuerRnZHTqLqCddacWSi/G ro2hjt4C3epHL259l13N/hSYfKCrMbMqUhnvYTGgUc3ezc4+ZMwHwUII65XkDfVcky33 ytcjD2tSkiL0QMqsfOeaYg4GeCCVf008kUZBCEp/fLvsquqdWZBYpRbnBso/wesl9qBZ aDuAinG7SWLN2vkTH8ab9FXzYiXA/r9vGExhlbevu0OS0Lx9FkM3FPeqQbEZNCb7ih6S 08Vv6PEBkmVHDu8dJJ2+B4AmWB4WK7EOGksfZ2Euwj7HctHA1/e01OBKQ+KW8WFrqyoR +71Q== 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=DC1Spcz6XibfSD3gTEIjLDTxs+1j3zVr9HN12XxNxNk=; b=Nuafj5GawO7u+M7xvcCysNWyXi0i5q1FpWjPf4ExYGqawA2ZOJPw8UvA/IZpPzAaH6 fxmxDoyAHMzBFEnZGU8w4jnEM/3GpXNwPTLdKgoUTokTuRwO50sDEMLuKW/s4ccx9W6S KS9i4a2WSrMYYItb0YpW5DZPjwX4/rWC/r0rwEXcF18IKfy7XcRwvo2efDXPaXPywDzl HozbxylhBTSbBV1RGVnQrl83o0h3B4Os0S1EiHhvJXS2axr2a6PjZTtT5vLDT9fMkpE0 clvlK1i6D6yJlXjl++qaCU8b3yndCc+6DHnExDVG2PfL4lt+oSDsXW5UvGVzCMcWDif/ cu/A== X-Gm-Message-State: AJaThX4JGolqZLvZneu1OEx5W0E1c6ftq/IEwtNScKi1rqLH+WpbVvQd pw0Hry87nJhE5a2vat/FRZI= X-Google-Smtp-Source: AGs4zMZX8dlRL04goJa1k3rOrMJe7/7D1DqjOxJvrg9nxYmQWG/h66yFl0qJnCfsRncISVOOUiTwJQ== X-Received: by 10.36.176.9 with SMTP id d9mr104174itf.125.1511988257216; Wed, 29 Nov 2017 12:44:17 -0800 (PST) Received: from ebiggers-linuxstation.kir.corp.google.com ([100.66.175.88]) by smtp.gmail.com with ESMTPSA id l4sm1111112ioc.69.2017.11.29.12.44.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Nov 2017 12:44:16 -0800 (PST) From: Eric Biggers To: linux-mtd@lists.infradead.org, Richard Weinberger Cc: linux-fscrypt@vger.kernel.org, Artem Bityutskiy , Adrian Hunter , Eric Biggers Subject: [PATCH v2 2/5] ubifs: switch to fscrypt_prepare_link() Date: Wed, 29 Nov 2017 12:43:14 -0800 Message-Id: <20171129204317.91205-3-ebiggers3@gmail.com> X-Mailer: git-send-email 2.15.0.531.g2ccb3012c9-goog In-Reply-To: <20171129204317.91205-1-ebiggers3@gmail.com> References: <20171129204317.91205-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 Signed-off-by: Eric Biggers --- fs/ubifs/dir.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 417fe0b29f23..09e6c56b11bc 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -743,9 +743,9 @@ static int ubifs_link(struct dentry *old_dentry, struct inode *dir, ubifs_assert(inode_is_locked(dir)); ubifs_assert(inode_is_locked(inode)); - if (ubifs_crypt_is_encrypted(dir) && - !fscrypt_has_permitted_context(dir, inode)) - return -EPERM; + err = fscrypt_prepare_link(old_dentry, dir, dentry); + if (err) + return err; err = fscrypt_setup_filename(dir, &dentry->d_name, 0, &nm); if (err)