From patchwork Sun Apr 3 05:22:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 8732961 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 04DD49F36E for ; Sun, 3 Apr 2016 05:25:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F8B020251 for ; Sun, 3 Apr 2016 05:25:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 666402022D for ; Sun, 3 Apr 2016 05:25:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752552AbcDCFXq (ORCPT ); Sun, 3 Apr 2016 01:23:46 -0400 Received: from mail-ig0-f195.google.com ([209.85.213.195]:35597 "EHLO mail-ig0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752460AbcDCFXo (ORCPT ); Sun, 3 Apr 2016 01:23:44 -0400 Received: by mail-ig0-f195.google.com with SMTP id ya17so7659238igc.2; Sat, 02 Apr 2016 22:23:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uVmSDcnZq2KwrV0djxjGKEqW63PI0ai4qO+n/jnVzvU=; b=ChNk+Kd+t3U5QyMZiCIlkbfGKyGSKN+HVsyfOfaed2qKIkvgkYsJ4N8HkEJWAsqZT6 f5HyLY4A1K9MM+df/48bfIANDWWdaOMJkd15uZsHB3Jly6/kd32yMGb7h3/lu0KLhnu3 OvI4KGIpqNDBXuWy8vRkng6S8T4qYN7ErGzx9q0obFclJLGyRWWRUHup9dGrmnyW9+8o PVDjACRG6uL/n2ulD9gB0TRoFypq0aOVs9YtrakA7+O/X41yKj4plmAnq9DmOj7mK/0I qQMVQN5MbZE2D/mmqSv6C2FeekQ+BkTju1ensUX4ng1iXFKABXm/2aLrN4XzeQA2MMMJ A4Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uVmSDcnZq2KwrV0djxjGKEqW63PI0ai4qO+n/jnVzvU=; b=ZhCRdQ1GCGW9a6dpNXtGDO00cfugNclshBuSIu6Jai2Xu+O66Jpep88NXYGhxN2b5a 4BZWD6Gh9vtoibuAu9pWKjBSNKarXUvHnptEzYDtEe3uO3tmxWmKKI7LyPrWHGCNDAXN 11rtXlpxtQcTAyOXpwwiy93tmt/2AXFD+9284JkLP+fQP+0njFcFgQqWbaGtwETlLliV RRMZD21GkAe50qyHSJylONEj1d1PJUYdBR58RXtzXDzq21JhtYGOsIJXBg81+C50KwGJ O5rw41t+7/Ed5ehM23rTUDxmIfZb8UdUVcgzcovsLPbxsajC4Lxr6eWUk0cqCGrWo16M g8XQ== X-Gm-Message-State: AD7BkJJF3L89Y/hPgZwMLTt7z/49Z1aO1PBCYXGsXrSxJT6TOhwro8sx3+5KpJ4DHyB/+g== X-Received: by 10.50.154.10 with SMTP id vk10mr5497067igb.74.1459661023989; Sat, 02 Apr 2016 22:23:43 -0700 (PDT) Received: from localhost.localdomain (c-24-7-245-123.hsd1.mn.comcast.net. [24.7.245.123]) by smtp.gmail.com with ESMTPSA id je6sm2914954igb.15.2016.04.02.22.23.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 02 Apr 2016 22:23:43 -0700 (PDT) From: Eric Biggers To: linux-fsdevel@vger.kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, jaegeuk@kernel.org, tytso@mit.edu, mhalcrow@google.com, Eric Biggers Subject: [PATCH 09/13] fscrypto: make fname_encrypt() actually return length of ciphertext Date: Sun, 3 Apr 2016 00:22:00 -0500 Message-Id: <1459660924-2960-10-git-send-email-ebiggers3@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1459660924-2960-1-git-send-email-ebiggers3@gmail.com> References: <1459660924-2960-1-git-send-email-ebiggers3@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This makes the return value match the comment. Previously it would actually return 0 if encryption was successful. (No callers currently care.) Signed-off-by: Eric Biggers --- fs/crypto/fname.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/crypto/fname.c b/fs/crypto/fname.c index e5c6959..5b10b73 100644 --- a/fs/crypto/fname.c +++ b/fs/crypto/fname.c @@ -100,12 +100,13 @@ static int fname_encrypt(struct inode *inode, } kfree(alloc_buf); skcipher_request_free(req); - if (res < 0) + if (res < 0) { printk_ratelimited(KERN_ERR "%s: Error (error code %d)\n", __func__, res); - + return res; + } oname->len = ciphertext_len; - return res; + return ciphertext_len; } /*