From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751907AbdFJIEi (ORCPT ); Sat, 10 Jun 2017 04:04:38 -0400 Received: from mx2.suse.de ([195.135.220.15]:36606 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751840AbdFJIEf (ORCPT ); Sat, 10 Jun 2017 04:04:35 -0400 Subject: Re: [PATCH] loop: fix error handling regression To: Arnd Bergmann , Jens Axboe Cc: Ming Lei , Omar Sandoval , linux-kernel@vger.kernel.org References: <20170609101938.2807152-1-arnd@arndb.de> From: Hannes Reinecke Message-ID: <67f0c728-aaa0-627a-a0e9-0ffe47cca87e@suse.de> Date: Sat, 10 Jun 2017 10:04:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <20170609101938.2807152-1-arnd@arndb.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/09/2017 12:19 PM, Arnd Bergmann wrote: > gcc points out an unusual indentation: > > drivers/block/loop.c: In function 'loop_set_status': > drivers/block/loop.c:1149:3: error: this 'if' clause does not guard... [-Werror=misleading-indentation] > if (figure_loop_size(lo, info->lo_offset, info->lo_sizelimit, > ^~ > drivers/block/loop.c:1152:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' > goto exit; > > This was introduced by a new feature that accidentally moved the opening > braces from one condition to another. Adding a second pair of braces > makes it work correctly again and also more readable. > > Fixes: f2c6df7dbf9a ("loop: support 4k physical blocksize") > Signed-off-by: Arnd Bergmann > --- > drivers/block/loop.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/block/loop.c b/drivers/block/loop.c > index 4d376c10a97a..e288fb30100f 100644 > --- a/drivers/block/loop.c > +++ b/drivers/block/loop.c > @@ -1147,10 +1147,11 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info) > ((lo->lo_flags & LO_FLAGS_BLOCKSIZE) && > lo->lo_logical_blocksize != LO_INFO_BLOCKSIZE(info))) { > if (figure_loop_size(lo, info->lo_offset, info->lo_sizelimit, > - LO_INFO_BLOCKSIZE(info))) > + LO_INFO_BLOCKSIZE(info))) { > err = -EFBIG; > goto exit; > } > + } > > loop_config_discard(lo); > > Oops. You are correct, of course. Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke zSeries & Storage hare@suse.de +49 911 74053 688 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)