From patchwork Thu Feb 22 15:56:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10235813 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4696060224 for ; Thu, 22 Feb 2018 15:57:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E9A428D54 for ; Thu, 22 Feb 2018 15:57:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3316228E02; Thu, 22 Feb 2018 15:57:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BFFCA28D54 for ; Thu, 22 Feb 2018 15:57:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E7C3A2BBDF4; Thu, 22 Feb 2018 15:56:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9EC6E60C97; Thu, 22 Feb 2018 15:56:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 492A918033EA; Thu, 22 Feb 2018 15:56:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w1MFurHn023955 for ; Thu, 22 Feb 2018 10:56:53 -0500 Received: by smtp.corp.redhat.com (Postfix) id 721425EDF5; Thu, 22 Feb 2018 15:56:53 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1FFB85D793; Thu, 22 Feb 2018 15:56:43 +0000 (UTC) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 239EA3EA6D1; Thu, 22 Feb 2018 15:56:42 +0000 (UTC) Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.129]) with ESMTPA (Nemesis) id 0MSlXs-1fE5cD06cO-00RZX0; Thu, 22 Feb 2018 16:56:33 +0100 From: Arnd Bergmann To: Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com Date: Thu, 22 Feb 2018 16:56:16 +0100 Message-Id: <20180222155627.1800948-1-arnd@arndb.de> X-Provags-ID: V03:K0:OloavdFxcc0SYV1ReVWVno8oZIFbD7y8LyCxKuyHydLQIfmLQI4 L9cwJ0cbXTP9WtijVZSSO2uU7cfSUqM0GoxWTeur2UcEYZxtIsKm/qos/REOKYEOcNGKrsw 48A83BtiffY0IdqFUZDYhJU6/NIaIzDE118kw8EmGCUStoqu0Jwy0OOaBg9IlBNw4xpRjLz MsKnr82cKCWTJwUP13qzA== X-UI-Out-Filterresults: notjunk:1; V01:K0:xH7tW0HxGGg=:n9rNIC1u0j723GrHXnPUBa Q8FfwrbevYrLPXSfGfx/WI1gVBfc1qQJRR48o0E8f5hDvDs3zPFKc1vy5dehHPcvXeWRMIeXn 4c3h/+SyWfzhvXABrOt3l51PDR4+MmNrJ5VyFRSGeKDrmTgiTllhvLBtQcUWa73j+VIGJSc7N MhpsHtgKLyeyDEHeR+bfNllla3hxIyyVayh9CznHg1CuJSzhIS9gsXt78ALeBealMHSmH7z7q 1Kb5fMt1vqumI7P+Bs+uYQu0JofUwslDrJIYzR0/+rqGASUYxzBVhr5c1OkeACCZIr838Q9wU 883ZMc/wK93xX542LRXdNTuVvikUN2s9e3EIFUvhcJ7PhP42jbiQirXryBxmcLM0BVuFz5gzF PKoceCAvMTggpEpJvl2tRlIJIugajDst46IDWWVV6akPzJ79HQ5K/+g6YQEblta7WLpJPBTW+ I028d1zHLy3TqqPd/5KNCPJzc8zre9krQ9XxZEGmsqZWtx4Fi4zC84PNhRcAHTWe4rV8bcvHu /IvR1Is849PotBryd49t3xRYX0PRprBsQlx7rg7FV0SkSTCICIkzqo0adexKobSmKCstgXtsZ feaHx2PIXRdYnWqCkUuS7PgCVq1MIvHCA3vGeMm8KTVdRno74Pm9HAVFvMx+CnVcgagY/ZfvB YmLmrSB9ghcUpty0DM0HFx62vVm5o0ol/RglxJrxRfVImxWKgFHRCxQWo91Z3J74++kau7b7C zxWGy/6Ld4caEMOIOFWfpSM00wq/l4dgZpkKHw== X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 22 Feb 2018 15:56:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 22 Feb 2018 15:56:42 +0000 (UTC) for IP:'212.227.126.187' DOMAIN:'mout.kundenserver.de' HELO:'mout.kundenserver.de' FROM:'arnd@arndb.de' RCPT:'' X-RedHat-Spam-Score: -0.011 (RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2) 212.227.126.187 mout.kundenserver.de 212.227.126.187 mout.kundenserver.de X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: dm-devel@redhat.com Cc: Jens Axboe , Mark Rutland , Jan Kara , Arnd Bergmann , Eric Biggers , linux-kernel@vger.kernel.org, Aliaksei Karaliou , Mikulas Patocka , Ingo Molnar , Dan Carpenter Subject: [dm-devel] [PATCH] dm-bufio: avoid false-positive Wmaybe-uninitialized warning X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 22 Feb 2018 15:57:00 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP gcc-6.3 and earlier show a new warning after a seemingly unrelated change to the arm64 PAGE_KERNEL definition: In file included from drivers/md/dm-bufio.c:14:0: drivers/md/dm-bufio.c: In function 'alloc_buffer': include/linux/sched/mm.h:182:56: warning: 'noio_flag' may be used uninitialized in this function [-Wmaybe-uninitialized] current->flags = (current->flags & ~PF_MEMALLOC_NOIO) | flags; ^ The same warning happened earlier on linux-3.18 for MIPS and I did a workaround for that, but now it's come back. gcc-7 and newer are apparently smart enough to figure this out, and other architectures don't show it, so the best I could come up with is to rework the caller slightly in a way that makes it obvious enough to all arm64 compilers what is happening here. Fixes: 41acec624087 ("arm64: kpti: Make use of nG dependent on arm64_kernel_unmapped_at_el0()") Link: https://patchwork.kernel.org/patch/9692829/ Signed-off-by: Arnd Bergmann --- drivers/md/dm-bufio.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c index 414c9af54ded..e7ad6fc6a5ea 100644 --- a/drivers/md/dm-bufio.c +++ b/drivers/md/dm-bufio.c @@ -413,13 +413,13 @@ static void *alloc_buffer_data(struct dm_bufio_client *c, gfp_t gfp_mask, * as if GFP_NOIO was specified. */ - if (gfp_mask & __GFP_NORETRY) + if (gfp_mask & __GFP_NORETRY) { noio_flag = memalloc_noio_save(); - - ptr = __vmalloc(c->block_size, gfp_mask, PAGE_KERNEL); - - if (gfp_mask & __GFP_NORETRY) + ptr = __vmalloc(c->block_size, gfp_mask, PAGE_KERNEL); memalloc_noio_restore(noio_flag); + } else { + ptr = __vmalloc(c->block_size, gfp_mask, PAGE_KERNEL); + } return ptr; }