From patchwork Wed Sep 20 22:46:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 816590 X-Patchwork-Delegate: richard@nod.at 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="flcfXWE3"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="D7tzOiAI"; 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 3xyFWF46S4z9sBZ for ; Thu, 21 Sep 2017 08:57:29 +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=zUe6S76jpq9iM715YXcfGFG1ZJXt86K/ZU/TIY1SWlQ=; b=flcfXWE3xYfF9y4u73Vc/CI7lk /Zq/FwsbPHEY4wFRlOxUXWZMO1CAyZuHfCQw6+Cpa8zDi1RSV8ENnUpQTcZ5Ij5RvXWC8GjeRvmSx FwKscY1RuQlKWFTUUDzWWQgn+mnK+kO1sVAAxdnuTW6xDDoc9uABzSYVQhyIpPK3WnHebBkInNxAV f4GcowcEEj4NvZXlkDzQ1t/yPqS/kzToh6Dc+DT1dpzyc1ooF9T+wgU5AKsrctk3dcpxlVpZnx9rz UzZW+HZwf3qSmTTv2rNwxcG2aI3h7zHS3szmCvTS2F8fDM2JCoguY6upGYZU/NR6MXboiIQcaaufN U5hUsO9Q==; 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 1dunvo-00079E-SB; Wed, 20 Sep 2017 22:57:24 +0000 Received: from mail-pg0-f67.google.com ([74.125.83.67]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dunmN-000586-HH for linux-mtd@lists.infradead.org; Wed, 20 Sep 2017 22:47:46 +0000 Received: by mail-pg0-f67.google.com with SMTP id v5so2365634pgn.4 for ; Wed, 20 Sep 2017 15:47:18 -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=XznOxbscM+Guz7zyOXZEtQLXMiA7EjYNtJ+c92S6E2g=; b=D7tzOiAIDtv8O95WdUO+BrCXDAqYvOu/MKUWr37+QByGJrRobenputFeMHEpiaySTl 7TLsHNYVt47q/lOQNhZXqh3gKoh7aKBQZprHH5mh0tcqg00qWbtsALNb1HWDU7cazncd xTlQdxPoCX+RLwN8BeZ01amwu9pEh8KCvv7N/HxC454CErpqQ5X5JhqDXPDvr4356a+e 0nahPMHmsXWTsQBPIzi4RQbIQMg9sNCJBbXJY8+2DGjsLjlX0YDWxaIg6a/uhrRlEdvi 1Wueop06sTeqrEA3+lDz/mCTsoefwLN5idbCiTzF9zdj9acZ08PFZFHUF1AElMPquEBg cVRQ== 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=XznOxbscM+Guz7zyOXZEtQLXMiA7EjYNtJ+c92S6E2g=; b=Iu2rK68POEXhedFGwF59Us/ca5XXPTp6A+atCUCgBjSo5cue5B/UU6rOOsD3cQM8CI m7EHxGapPi4VgQj4VT36BAmbBen1AMAocSR3MW5b0D2DnsSNjNZfDnl3OCcHs2JTg38F xhPPTt6qe6aZw9UnCfeo+YMDSYeFMsnsU6P6VAjfxIDYOGYExDhgXu8ac8XaX9U0yUed j8eiZyRChRn8xO6vIGtaW1o40L06inQQUi/uKd9g2+2PyFTSQWLpzxYzINUxjoPTkuJe LdDIa1qMaIBup7QjGcSzzPrVJYmqBSSKBG566H95BppnTqMfG+X0MPjPfMtRRuuK/E3T wZiA== X-Gm-Message-State: AHPjjUhaE76Vg2iwPGjBzuhHAuMIp2AXTwXnvnOVTFxAXVdMg6FZ5x4O znxK5pOvm5f5/aLD8ACBToI= X-Google-Smtp-Source: AOwi7QCsWbwbVr0eemv3tcaQWLmjvNRB+oCcrRAR5Ouepwi5z66gjMJabzhiWBxFghiiLSXtrqrPHQ== X-Received: by 10.84.143.165 with SMTP id 34mr3393170plz.91.1505947638274; Wed, 20 Sep 2017 15:47:18 -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.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Sep 2017 15:47:17 -0700 (PDT) From: Eric Biggers To: linux-fscrypt@vger.kernel.org Subject: [PATCH 25/25] ubifs: switch to fscrypt_prepare_setattr() Date: Wed, 20 Sep 2017 15:46:05 -0700 Message-Id: <20170920224605.22030-26-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_154740_885413_5FA90FB4 X-CRM114-Status: UNSURE ( 9.42 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.3 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source [74.125.83.67 listed in dnsbl.sorbs.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [74.125.83.67 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.83.67 listed in wl.mailspike.net] -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 Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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/ubifs/file.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index 31dc632a52fc..f5578f1bd170 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c @@ -1284,13 +1284,9 @@ int ubifs_setattr(struct dentry *dentry, struct iattr *attr) if (err) return err; - if (ubifs_crypt_is_encrypted(inode) && (attr->ia_valid & ATTR_SIZE)) { - err = fscrypt_get_encryption_info(inode); - if (err) - return err; - if (!fscrypt_has_encryption_key(inode)) - return -ENOKEY; - } + err = fscrypt_prepare_setattr(dentry, attr); + if (err) + return err; if ((attr->ia_valid & ATTR_SIZE) && attr->ia_size < inode->i_size) /* Truncation to a smaller size */