Message ID | 20170920224605.22030-12-ebiggers3@gmail.com |
---|---|
State | Not Applicable |
Headers | show
Return-Path: <linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="m9DIr8Uw"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="y4Dco1aa"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kLXBsgB/"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xyGjl6g0Sz9s7h for <incoming@patchwork.ozlabs.org>; Thu, 21 Sep 2017 09:51:39 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Mq6OznoBzyHNd04QK7qC70r891FEAApJZXO3oZYzH8g=; b=m9DIr8Uwej/knFc+a0yPlFF+V0 qxYgOji6LOG5EW/8W09R+nz5JYsyCMAv9bmk4Yz1v3n+MKfsP7C2zpZrYhkZjOzLt3j2Eeo3Wq53J +BMhTemUb8P/qQPYjS/sHU3zvqwa/7WSJ55bSuZ7JEQLrV2rt0jCxyyxDSRUt4V7poZLD5cF7Z6m3 eqdfopHpPGmVLc8q7Wp/N8fnydUWt6n9wLw0X+hQrCQLAMWBtDojLTr6a6oMU/OMfcHb2LmekvZGb FXdi8ys5X3Xe1q6zHS1o7T6EXakOy3kAmTwp6CfMB0PaMLjE/FYqv3zjLj+1drHcnehwoUagTKMQS Thq1WChA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1duomF-0003l4-Q3; Wed, 20 Sep 2017 23:51:35 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1duok6-0001Bu-Mr for linux-mtd@bombadil.infradead.org; Wed, 20 Sep 2017 23:49:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=WkaWCp5pR1c59n1k9Hk5rcxNp21Vt5Cmt3ZJ6yMdHpg=; b=y4Dco1aai2WqZ3jgNPKuiYYVH vq69hMl2QH+d8+ZY7YfphC9Zsd7dfRKASiBxpUrLP4I2mq3jwKKTNezCMIm5f8A+DDFUbbXehdSki 1K8UdUCZCfsN8G8YcD92rOwTD8t+wqP1mZuSkB5UzignlsmWVE/vRqBxDj7+RIFlxuIRTyjmZlisn I6PWWvIXinbj8TGwAjXf0fpenApYAG2KS4RVls76X5knxpio1Wv4zDtxdhuGGY/z3e1ccmLn6Lb+K 1ct1+PFxpPdn2oi60OcYn0Rxar8IKAzKuZXRhpEA652+q9sJcg83EfCfmJCt007jGhXzSFUo3uQzc pqAReT2bw==; Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dunmC-00017O-QT for linux-mtd@lists.infradead.org; Wed, 20 Sep 2017 22:47:29 +0000 Received: by mail-pg0-x243.google.com with SMTP id m30so2366824pgn.5 for <linux-mtd@lists.infradead.org>; Wed, 20 Sep 2017 15:47:05 -0700 (PDT) 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=WkaWCp5pR1c59n1k9Hk5rcxNp21Vt5Cmt3ZJ6yMdHpg=; b=kLXBsgB/KIfRmHIqIuxnfkunzMEUBshljntVnRWppmlvFvnCqE9uyePCu/uDvcrqXC mzOjBc67AoIS1Rw/HzG95KbZNWKhre/94h9xe2Q5leEZt6YFGYuTk2JN3i/Yj05ZrFoW eC1ZDdc1OZ9UEYsfu6SwB+QQ4/sSqNrs48j/xGkCj9/OmONZmiWFTwRH4ClToC7+gFux X+7y/hBDRISv5gUJUoQ9X/u5Z+xz7QXZVRwlSsPMC79uKT1hNciWmx0Xx4bTwBYmsdeK LsEjYBS8LxYVYOnFK2VtCztbwG3jP84yZ5uAnJZK0IyiYIzze826phYFAjY69pkXxEMr R54g== 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=WkaWCp5pR1c59n1k9Hk5rcxNp21Vt5Cmt3ZJ6yMdHpg=; b=J3tw1Oj2/c/GuiJkfHubxSGqeKMSI9ykSj2OpaHkjZVVSrEGKz4IitrQhHFznZyTBa tyON9kzIe4KB3UXYLaUGLRAXEW1vnTxx7qU9pLcGMkoBkgmD6gfInMk3X4RUKuoHeAnG 9G+IFxiECq/BuQwMYlJVzLzOwfnzHTgxdCT22tK0tmox5ggvm5quVb1pGt+LtCNZRcZi RHDG69d1mnr4kbpWUJpwvkO2DyrujGK9M6aN3HAwjuFVtiubP8llxBXCONcHLwhEELaD igmTZPkBvrbIpv3in1EMOP64QrHrzc58elcXaQr5nzmFTj+NqA5FvoA3bOu2s5TUnANL wXtg== X-Gm-Message-State: AHPjjUgHRsES7Xl/jDatP1bxHQdFjKJTrbMj1E+ybO2nPc9cv+zHR1O3 jmL+b/iNkr4yTuH0YApAJZcA3IxUrus= X-Google-Smtp-Source: AOwi7QA1vfrMiRTSlpSYAT012BUIs2xUqd4Ah8lXY7/pjuw6Nn4/CBBg5+NwmSjxeVIX4w/6gywkvQ== X-Received: by 10.99.168.1 with SMTP id o1mr3640561pgf.72.1505947623552; Wed, 20 Sep 2017 15:47:03 -0700 (PDT) Received: from ebiggers-linuxstation.kir.corp.google.com ([100.66.174.81]) by smtp.gmail.com with ESMTPSA id j2sm6249pgn.26.2017.09.20.15.47.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Sep 2017 15:47:03 -0700 (PDT) From: Eric Biggers <ebiggers3@gmail.com> To: linux-fscrypt@vger.kernel.org Subject: [PATCH 11/25] ext4: switch to fscrypt_file_open() Date: Wed, 20 Sep 2017 15:45:51 -0700 Message-Id: <20170920224605.22030-12-ebiggers3@gmail.com> X-Mailer: git-send-email 2.14.1.821.g8fa685d3b7-goog In-Reply-To: <20170920224605.22030-1-ebiggers3@gmail.com> References: <20170920224605.22030-1-ebiggers3@gmail.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.4.1 on merlin.infradead.org summary: Content analysis details: (-1.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c05:0:0:0:243 listed in] [list.dnswl.org] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (ebiggers3[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (ebiggers3[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list <linux-mtd.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-mtd>, <mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-mtd/> List-Post: <mailto:linux-mtd@lists.infradead.org> List-Help: <mailto:linux-mtd-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-mtd>, <mailto:linux-mtd-request@lists.infradead.org?subject=subscribe> Cc: "Theodore Y . Ts'o" <tytso@mit.edu>, Eric Biggers <ebiggers@google.com>, Michael Halcrow <mhalcrow@google.com>, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org, Jaegeuk Kim <jaegeuk@kernel.org>, linux-ext4@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" <linux-mtd-bounces@lists.infradead.org> Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org |
Series |
fscrypt: add some higher-level helper functions
|
expand
|
diff --git a/fs/ext4/file.c b/fs/ext4/file.c index b1da660ac3bc..ffe9144088f8 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c @@ -364,7 +364,6 @@ static int ext4_file_open(struct inode * inode, struct file * filp) struct super_block *sb = inode->i_sb; struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); struct vfsmount *mnt = filp->f_path.mnt; - struct dentry *dir; struct path path; char buf[64], *cp; int ret; @@ -404,25 +403,11 @@ static int ext4_file_open(struct inode * inode, struct file * filp) ext4_journal_stop(handle); } } - if (ext4_encrypted_inode(inode)) { - ret = fscrypt_get_encryption_info(inode); - if (ret) - return -EACCES; - if (!fscrypt_has_encryption_key(inode)) - return -ENOKEY; - } - dir = dget_parent(file_dentry(filp)); - if (ext4_encrypted_inode(d_inode(dir)) && - !fscrypt_has_permitted_context(d_inode(dir), inode)) { - ext4_warning(inode->i_sb, - "Inconsistent encryption contexts: %lu/%lu", - (unsigned long) d_inode(dir)->i_ino, - (unsigned long) inode->i_ino); - dput(dir); - return -EPERM; - } - dput(dir); + ret = fscrypt_file_open(inode, filp); + if (ret) + return ret; + /* * Set up the jbd2_inode if we are opening the inode for * writing and the journal is present