From patchwork Wed Sep 20 22:46:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 816593 Return-Path: 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=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HdstbwmN"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="AsPuQAnM"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cX2bz4f8"; 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 3xyFv03Yzzz9sNr for ; Thu, 21 Sep 2017 09:14:36 +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=Ly3k2KQUXGS3xDxLHHJV7P3ieyJo84Ttj0Jf6wTl8bA=; b=HdstbwmNPGPvLyfHZ9XTgeHmfb lhm5umMwg9CykJonQGPZ0pxthreFm/T3bHL9vV423tABaTpN7kvezYcXn0LckCM8xoipb6WxQnHj4 Gq6EH7lJ8ziMrVnRX25KbWefPsmvS9dtUBMdbMWvbFcc0U/Z4yLzeliaMbr3XK4pTPOf6gwuyV/rP G30NR7X0SUei6+AMhv3CsWEhJxq4rjHkQZF62Vi6Xev15D20k1kfTh9Fc3YAHJrzbp7KuchUJO56V amqpcsrEy46YgfI6cv2u94+5t8CKIiBIFI1pyHtUuEkcuf66/XhaV/o/9jvrYW1YDayjkDfuDFL9A HO0CKcwA==; 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 1duoCF-00009R-Vr; Wed, 20 Sep 2017 23:14:24 +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 1duoAn-0006fH-6Z for linux-mtd@bombadil.infradead.org; Wed, 20 Sep 2017 23:12:53 +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=HcNv1nt2o0K6eujfPHwQQ8L1eA79OyFs4BTE9JTg5Zg=; b=AsPuQAnMCZae34LDkkmADaMkF pvYIg78jczCs+lzuOAqZv1f9QaqQTL2u+312zPTtpFnbWfXlBtxt5xOyak6bfPVhvQuN8vObhJyag jaYcoOnxo5VMsEOY3zTVjAFP2nOdt9M9L8c9MBjbihyCmkcFiNsNZC/e3C5b6QU65wJ2WMhN+Z0W+ +S5zKyHxoVtejI75iHs3gCe426Fx0wjopictxmeE3UlYxvmyvMo+//NtpRYIhpRZjEkk9cKlFhzg9 KWyNM89FxOHtz+Kt7yr73zEWZfIsoGmOz6oYOtso3apOkeWUk+dallB6SXFmD+woDkNyHZBWFJZvV 6AqeAfcGA==; Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dunmI-0004t1-9i for linux-mtd@lists.infradead.org; Wed, 20 Sep 2017 22:47:35 +0000 Received: by mail-pg0-x244.google.com with SMTP id i130so2381602pgc.0 for ; Wed, 20 Sep 2017 15:47:14 -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=HcNv1nt2o0K6eujfPHwQQ8L1eA79OyFs4BTE9JTg5Zg=; b=cX2bz4f8iGmmN0YPhxb2vypZDJlNzdBglgXHsbHCVDnOzzJklTBoEchA5uZ2l8FQkl 8mzOZ4q8dPBXadNjxoFmu0hL6dydsuAUd6wzZzWg3KjZFZSP72v8I7jhXTe3v9DAomgq mSmhD5obe4E5hR6S3HaNfNnX4AJBDU+ptFn39W9xRadv4rIOcjfT2i9rXQI7hhh4HQkv HUvS1uPq77TSVGz7XfVOBEy2t+LzWJOPpF8wSiGs/TbqdGYbjqAOu4aCFJQJdrz/RbCN OZGRW8DQHGZUvWxzYqoNI07DA0/lthzqHh+BLG/FxHztae3Q9IQxb0vt3rl8j0BTLqcY n9sg== 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=HcNv1nt2o0K6eujfPHwQQ8L1eA79OyFs4BTE9JTg5Zg=; b=IWhhOREZxegWdl1S+CvlgXlGbrzWPuBG7b5kLxADbPEdBq+ySedHA0M/KdgQhecidR 0V2Mjx6BLJvkbDdp9c8UcVs87vjG3Ol1x2Et0VQDAPbeOPj3zfKh4c5oX9lm1p5gv7yY ext3CS0gF8FT1A5+8qXI0NCzp/oHjY3k67gU3E+tmjglkph5St6fOIpGRE0lqdUvPnQz E+NUJxT9734q3IN6VGG5ZrK2FsEsX5qSrjfi8t2/mqUEFyFkNc4RR0G7TH0XA1y0MH+V 34Yj0gf82e+snele/G6o0NKdcjNk85OWaBH+F8bdaDRqlib3Jv8b9Ani0HSDe/qZ48RD kNrg== X-Gm-Message-State: AHPjjUh4YBW1zvpjTdXmV3EsD0r+wmlqW9nIvA4Yk8VQc1ZSyRmrsvvU DEQpo5FhG17KXWyfU8eiP1ZRXtJv4SU= X-Google-Smtp-Source: AOwi7QBF6GKt47XSikS3s1sISupt9i/KqJvgIVIThE3it0ZCJb0SEwI/sa/VaICJZYr77cLIaExtjQ== X-Received: by 10.101.75.81 with SMTP id k17mr3598261pgt.369.1505947632766; Wed, 20 Sep 2017 15:47:12 -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.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Sep 2017 15:47:12 -0700 (PDT) From: Eric Biggers To: linux-fscrypt@vger.kernel.org Subject: [PATCH 20/25] f2fs: switch to fscrypt_prepare_setattr() Date: Wed, 20 Sep 2017 15:46:00 -0700 Message-Id: <20170920224605.22030-21-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_234734_483236_54F23B29 X-CRM114-Status: GOOD ( 10.95 ) 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:c05: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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Theodore Y . Ts'o" , Eric Biggers , Michael Halcrow , linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org, Jaegeuk Kim , linux-ext4@vger.kernel.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Eric Biggers Signed-off-by: Eric Biggers --- fs/f2fs/file.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 8cef3931a00b..629bb91fa44e 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -714,6 +714,10 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr) if (err) return err; + err = fscrypt_prepare_setattr(dentry, attr); + if (err) + return err; + if (is_quota_modification(inode, attr)) { err = dquot_initialize(inode); if (err) @@ -729,14 +733,6 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr) } if (attr->ia_valid & ATTR_SIZE) { - if (f2fs_encrypted_inode(inode)) { - err = fscrypt_get_encryption_info(inode); - if (err) - return err; - if (!fscrypt_has_encryption_key(inode)) - return -ENOKEY; - } - if (attr->ia_size <= i_size_read(inode)) { down_write(&F2FS_I(inode)->i_mmap_sem); truncate_setsize(inode, attr->ia_size);