From patchwork Sat Jan 2 19:50:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101217 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp4556512lbb; Sat, 2 Jan 2016 11:50:24 -0800 (PST) X-Received: by 10.98.18.11 with SMTP id a11mr114034730pfj.7.1451764224636; Sat, 02 Jan 2016 11:50:24 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 14si70552254pfi.32.2016.01.02.11.50.24; Sat, 02 Jan 2016 11:50:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751654AbcABTuW (ORCPT + 29 others); Sat, 2 Jan 2016 14:50:22 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:57292 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751210AbcABTuU (ORCPT ); Sat, 2 Jan 2016 14:50:20 -0500 Received: from wuerfel.localnet ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue103) with ESMTPSA (Nemesis) id 0LphYc-1ZmSxP0uVq-00fUtr; Sat, 02 Jan 2016 20:50:13 +0100 From: Arnd Bergmann To: Theodore Ts'o Cc: Andreas Dilger , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ext4: disable retry logic in ext4_set_encrypted_filename Date: Sat, 02 Jan 2016 20:50:11 +0100 Message-ID: <3125077.SmBO9VTSER@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE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LDaLsyRUjs Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc correctly warns that the ctx variable in ext4_set_encrypted_filename has gone out of scope in ext4_set_encrypted_filename if we enter the retry path and a 'goto' into the previous code block can not guarantee to get the contents back: fs/ext4/namei.c: In function 'ext4_set_encrypted_filename': fs/ext4/namei.c:4035:10: warning: 'ctx' may be used uninitialized in this function [-Wmaybe-uninitialized] retval = ext4_xattr_set_handle(handle, inode, I tried moving the variable declaration to the start of the function, but that does not shut up the warning, as it's apparently too hard for the compiler to follow the control flow and determine that it's correct (or for me reading the code, for that matter). This adds a hack to avoid the undefined behavior at the cost of losing the chance to retry on a spurious -ENOSPC error. We probably need a better solution. Signed-off-by: Arnd Bergmann Fixes: 374431bae296 ("ext4 crypto: add ioctls to allow backup of encryption metadata") --- The warning appeared with next-20121231, which is the latest next release, nevermind if it has already been fixed in the meantime. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index c03f310200d6..fd2bd090bdfa 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -4113,7 +4113,7 @@ out: } if (handle) ext4_journal_stop(handle); - if (do_retry) { + if (do_retry /* FIXME: ctx is invalid */ && 0) { do_retry = 0; goto retry; }