Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2974446imu; Sun, 9 Dec 2018 14:04:03 -0800 (PST) X-Google-Smtp-Source: AFSGD/UdOP5UHZ8wk6JASD0EpKLvUHTpPTLEQZFFyjEIBPSiGRsSU/sWpUTEsK1o9F5qlmW+KlJs X-Received: by 2002:a63:ed15:: with SMTP id d21mr8724558pgi.305.1544393043700; Sun, 09 Dec 2018 14:04:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544393043; cv=none; d=google.com; s=arc-20160816; b=nxPkivWefabSYf8YMYXmS7UFzFTyXMRXkYhSlXn7XGZxOSnuKXE5VdhjDFpHbSktmN tE50jJbnd4Volzh8/0ORhY2xOBCPCrYMKk9jdvVjesyaJQK+Udbv4mE/0QfpBbnMh/RF UaCgXjp2dr9ugMteWg5kSqL+j4YHrZI5DaYi7YykVuojTH6qGXQzNu9IVEfq7Mw/hF/e C+RRo2V372fjWKDKF8hKa14GPhTWGxitV039bFnveJAfb0LA1GLxulziJSq25vBKG7g4 iY5umT/eZmxOKTe/4NfOPP9or04QJYKiYcFH4uGr+e30Jh/U5KJSHqQxlcqXfGwFdX0H 2GzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=YDgaHUWb0x9gf0HhSm879KGw0U3Yms1Gi1GsNSnbvR4=; b=wor2qV6q/EvvcmwEqz5oMEBqX1nq+CU2xO2pp8COnmU62JLSn8645ovd9K/Frc3XoB bHw+IFSlnT0cTus3gULfFFQp3/KjBoLSWd+5Ciwq9saGvjkqItWoR0IlFjc+irlDxy54 vKYDlRNoYnnP39sGvyz21ASBu2OWj1jALMyp2C3yvuDDeR5gmuvOKEouxrn1z0bAc6/F ChSivVdymx3ASyyY59xq+VQ+lpjAlTyMJ/+1DptBXWeEs+9P8rHY6YlK4kJ4PYpx1t96 KAQUrcZy8YqiYoXK0qZE0miAIeoRF6Ih4O9c9uATLo97fBHbScPYi7maUgpdkBViHyzc BmGg== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q16si6046272pfh.138.2018.12.09.14.03.48; Sun, 09 Dec 2018 14:04:03 -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 S1727243AbeLIWBQ (ORCPT + 99 others); Sun, 9 Dec 2018 17:01:16 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:35964 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726680AbeLIVze (ORCPT ); Sun, 9 Dec 2018 16:55:34 -0500 Received: from pub.yeoldevic.com ([81.174.156.145] helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gW72x-0002im-5O; Sun, 09 Dec 2018 21:55:31 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gW72j-0003bc-8k; Sun, 09 Dec 2018 21:55:17 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Jens Axboe" , "Christoph Hellwig" Date: Sun, 09 Dec 2018 21:50:33 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 265/328] bcache: don't embed 'return' statements in closure macros In-Reply-To: X-SA-Exim-Connect-IP: 81.174.156.145 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.62-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Jens Axboe commit 77b5a08427e87514c33730afc18cd02c9475e2c3 upstream. This is horribly confusing, it breaks the flow of the code without it being apparent in the caller. Signed-off-by: Jens Axboe Acked-by: Christoph Hellwig Signed-off-by: Ben Hutchings --- drivers/md/bcache/closure.h | 3 --- drivers/md/bcache/io.c | 1 + drivers/md/bcache/journal.c | 2 ++ drivers/md/bcache/request.c | 14 +++++++++++--- 4 files changed, 14 insertions(+), 6 deletions(-) --- a/drivers/md/bcache/closure.h +++ b/drivers/md/bcache/closure.h @@ -320,7 +320,6 @@ static inline void closure_wake_up(struc do { \ set_closure_fn(_cl, _fn, _wq); \ closure_sub(_cl, CLOSURE_RUNNING + 1); \ - return; \ } while (0) /** @@ -349,7 +348,6 @@ do { \ do { \ set_closure_fn(_cl, _fn, _wq); \ closure_queue(_cl); \ - return; \ } while (0) /** @@ -365,7 +363,6 @@ do { \ do { \ set_closure_fn(_cl, _destructor, NULL); \ closure_sub(_cl, CLOSURE_RUNNING - CLOSURE_DESTRUCTOR + 1); \ - return; \ } while (0) /** --- a/drivers/md/bcache/io.c +++ b/drivers/md/bcache/io.c @@ -105,6 +105,7 @@ void bch_generic_make_request(struct bio } while (n != bio); continue_at(&s->cl, bch_bio_submit_split_done, NULL); + return; submit: generic_make_request(bio); } --- a/drivers/md/bcache/journal.c +++ b/drivers/md/bcache/journal.c @@ -586,12 +586,14 @@ static void journal_write_unlocked(struc if (!w->need_write) { closure_return_with_destructor(cl, journal_write_unlock); + return; } else if (journal_full(&c->journal)) { journal_reclaim(c); spin_unlock(&c->journal.lock); btree_flush_write(c); continue_at(cl, journal_write, system_wq); + return; } c->journal.blocks_free -= set_blocks(w->data, block_bytes(c)); --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c @@ -87,8 +87,10 @@ static void bch_data_insert_keys(struct if (journal_ref) atomic_dec_bug(journal_ref); - if (!op->insert_data_done) + if (!op->insert_data_done) { continue_at(cl, bch_data_insert_start, op->wq); + return; + } bch_keylist_free(&op->insert_keys); closure_return(cl); @@ -215,8 +217,10 @@ static void bch_data_insert_start(struct /* 1 for the device pointer and 1 for the chksum */ if (bch_keylist_realloc(&op->insert_keys, 3 + (op->csum ? 1 : 0), - op->c)) + op->c)) { continue_at(cl, bch_data_insert_keys, op->wq); + return; + } k = op->insert_keys.top; bkey_init(k); @@ -254,6 +258,7 @@ static void bch_data_insert_start(struct op->insert_data_done = true; continue_at(cl, bch_data_insert_keys, op->wq); + return; err: /* bch_alloc_sectors() blocks if s->writeback = true */ BUG_ON(op->writeback); @@ -568,8 +573,10 @@ static void cache_lookup(struct closure ret = bch_btree_map_keys(&s->op, s->iop.c, &KEY(s->iop.inode, bio->bi_iter.bi_sector, 0), cache_lookup_fn, MAP_END_KEY); - if (ret == -EAGAIN) + if (ret == -EAGAIN) { continue_at(cl, cache_lookup, bcache_wq); + return; + } closure_return(cl); } @@ -1095,6 +1102,7 @@ static void flash_dev_make_request(struc continue_at_nobarrier(&s->cl, flash_dev_nodata, bcache_wq); + return; } else if (rw) { bch_keybuf_check_overlapping(&s->iop.c->moving_gc_keys, &KEY(d->id, bio->bi_iter.bi_sector, 0),