Message ID | 20170920224605.22030-17-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="NgJETM51"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="qnEknhyh"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="NgTwGUYd"; 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 3xyFvR2XSSz9sNr for <incoming@patchwork.ozlabs.org>; Thu, 21 Sep 2017 09:14:59 +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=Xw+SA7uyu1712SrUUJC8QEjouhAGAQmyrDcb//nr0ng=; b=NgJETM51auKNCLTdC8Q78qtsdQ 8sELlX1gkkZhunvOSprrtaJj2xsJZiSrKTV2S50Hnn1+b+4E99AxDP02UQf74zTBsfH66LfM07qX7 c4EHw8YtvRmHNMp4tq6zLXFFTyMWLynri+62PF6bs6v2F+fE6iNvxjw9RCUDsdDRsqfPmdhllL/y9 U0HJEFR6ZcyUqh1so0vNI25gNFUQ/1F+5aTKlC/j044C2HcFl5m8xgqYXX1b61rSxs2iFbatsO3Pv z5W9DjxcyZWX9nlt0b4qEaCPtxPMi6tGukgTKFrcMQZNnkODM5XB7ev6JkDcWZEKTrbnMMOeqjYqY iAo1EmTA==; 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 1duoCg-0000YB-A6; Wed, 20 Sep 2017 23:14:50 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1duoAo-0006j8-QN for linux-mtd@bombadil.infradead.org; Wed, 20 Sep 2017 23:12:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=lWFOShztuG2e44vH8e1SgZf/UIwGJpJgCSa+VYbcXO4=; b=qnEknhyhQryl1Lg25FyerB109 ZCMe2W6cAksFNHIb6OlmW4K7MNJCpxwV5iHdc/M1VH5ZFrE6wJbrb+AkeG4lJk8B7frxEkoZPID7U LUr4Glx4siP7UBAib3f/hBpnO2i7V8LjhSyTshc3T2TW5YleNNhpUI5hlQwOnS3OYUFvfQ4ftOHQt v/mlkz34ZXapdICG1YhE5pYsS1cUuk3G842dvUtULmDrIaTbsXsMJovq+KVtZLwdZSvzPcrRMAKIr fwiN6Wmtwv1aHvmPAAcaV85Jxh0fWdI7QAFZaHiWLeZmxBSccfUoqkrp3HkAeEnkK2Pbn7v1LEtKy NO8T3dWXA==; Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dunmE-0004sw-3Q for linux-mtd@lists.infradead.org; Wed, 20 Sep 2017 22:47:31 +0000 Received: by mail-pf0-x244.google.com with SMTP id g65so1725834pfe.1 for <linux-mtd@lists.infradead.org>; Wed, 20 Sep 2017 15:47:09 -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=lWFOShztuG2e44vH8e1SgZf/UIwGJpJgCSa+VYbcXO4=; b=NgTwGUYdOUjO/fXYhw2ld4SZkileaQ+9XFm1uzpt1ObOHN8vIXW0004SALfA4k007s PCFsFkaugfIbP8yXm+ZELQwbLOEkIbInasImNw1YyHLI3XBxjHIHw6WGeN5hyYIPv23r 3LsyS2uuNyTW1OUMiihUrHx55OXiFC9RbTZKLFz3FBgkQoufFhWiY6MXhIWRHKPMu6Vz BgIi7W4FuVgqogVoh4EJW3BBj6wWvoKPb62LRJ1W+ood82UvFWdDR2wgls5zblDDuapX nyosoWThF9ByPpEYZ9nIxiR7VOnuCTAa5r3qn434zDgGiKR8PgHhy9GiwrAz9X2dtn7N iZKg== 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=lWFOShztuG2e44vH8e1SgZf/UIwGJpJgCSa+VYbcXO4=; b=U3D3YkvpKyZ1mCLSMXSGarg5VbNSPHbt/WLcz1Maip96OEnHAtVEsx41P7TKzHNMfF KNw+SKRXhFbbloRyfdHcWWFf5cxQ3KdX9gygsjW5ZRfCaqjh+a/8WvXdfYEMv3qvwFKo qsO9jnNZFQ1yuSV5JUvMeD+9JjZy2jbH5njIGyDJgQEzThUbT2gOp9snzqs/aX6Dk9tf 6/CEKluX8wLk+KFvZZR3Nup2GJatdxZx3Ah/jW/jE3Nt9gHV3tNlE9zBZ9HUURqzSYzf xMpvejADNB2BR4zhaqOI+hPow+WIRDlrsQc7PCybbTjGWG2lgSQk4puYuNMihj3iikui kpjA== X-Gm-Message-State: AHPjjUjq8HjVvlrLTAo1SNFv/BFeumWE4SQ3AGvjaebuyvxixYCRQSm0 ZVHf39SLj4D2Put4F5SjAko= X-Google-Smtp-Source: AOwi7QAH1K8wlhT8uaaAMUDMhjqW0utGUe71+/SneycNajOruJVSL1mIOwZkmX3djJPL+pQ45IyukQ== X-Received: by 10.98.157.139 with SMTP id a11mr3733281pfk.70.1505947628626; Wed, 20 Sep 2017 15:47:08 -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.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Sep 2017 15:47:08 -0700 (PDT) From: Eric Biggers <ebiggers3@gmail.com> To: linux-fscrypt@vger.kernel.org Subject: [PATCH 16/25] f2fs: switch to fscrypt_file_open() Date: Wed, 20 Sep 2017 15:45:56 -0700 Message-Id: <20170920224605.22030-17-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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170920_234730_280410_FDB21AAC X-CRM114-Status: GOOD ( 11.43 ) X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-1.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c00:0:0:0:244 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (ebiggers3[at]gmail.com) 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_VALID_AU Message has a valid DKIM or DK signature from author's domain 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 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/f2fs/file.c b/fs/f2fs/file.c index 517e112c8a9a..8cef3931a00b 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -455,22 +455,10 @@ static int f2fs_file_mmap(struct file *file, struct vm_area_struct *vma) static int f2fs_file_open(struct inode *inode, struct file *filp) { - struct dentry *dir; + int err = fscrypt_file_open(inode, filp); - if (f2fs_encrypted_inode(inode)) { - int 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 (f2fs_encrypted_inode(d_inode(dir)) && - !fscrypt_has_permitted_context(d_inode(dir), inode)) { - dput(dir); - return -EPERM; - } - dput(dir); + if (err) + return err; return dquot_file_open(inode, filp); }