Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp886028imm; Wed, 13 Jun 2018 09:47:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJZgOVSQT8eNuyAqtUYkkJumY/Bpv0LwY8vHMP9DZaIn2Aync4f7BHXsszaX7Ij8vSfnd14 X-Received: by 2002:a62:fc8d:: with SMTP id e135-v6mr5703661pfh.208.1528908432741; Wed, 13 Jun 2018 09:47:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528908432; cv=none; d=google.com; s=arc-20160816; b=sAkh0kohRtLvwnQ8iutTwePJ79/a+xsWNeETda1boo+zgBeWoTXtgihdmM3LY3ra9T zWaWEo5MO1dd8x1PGLieGDDDQzrPrDQ7Ey8ZAVdtwvpTN18ffiWUFC8iAhmylZxKwolq hbZHN0ZzkHvNtYWPr5/Q90ljgMY9yHMS0EufDawCTvhBxj/5D1PmTXlRvcjgOVF34ViX /z8E2ey+cpf/yFyGZqqNYy+uVuR/IPFntweVM/gAbJ1xxphRBNRBFwu15y//+7VSXQAn anzjSCIgKJuTbBkUKiWKv3lupu+zI8ciTvW9RKdxwmH/mcfvSJFg31RJFZBSIovaq/2Y rzCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=E1UmcpTyma/ErCRxps73fki5ghfpxQUxgoS7Eddsy4o=; b=zC5FHY0TvenmDAd7YHCrY4Sc71mMh2KnJxBCgbSJ8KaDdUFt9uX0LJQQEyVFlNTXt7 Zv19xp+Clha4gjKGeiJ7k5oxnwMx3tKqVMOrV1Y39bW9dPRGvstwFITT2PVEjKquSyDJ FDb2CdPH/znPqyffya++6uYjw7N7+XmPrycxa5w/E8rjVKlywCO0XJGQ+6Zo1kkiFD2o eN2PpPLoXfxlmz/rc2ir61bB/+mPqjZgnNoZ0unzGsKBY0v7dfdfHUtKc3Bh/+0I+Pp1 ngncz0OHfy9c0+orh2fHflY/rQxoMR10KIxWJXcO0xzZP2qS3+Kb6n88GVBJ0acxScoL kp2Q== 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 z1-v6si2691876pgs.525.2018.06.13.09.46.56; Wed, 13 Jun 2018 09:47:12 -0700 (PDT) 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 S935219AbeFMQpN (ORCPT + 99 others); Wed, 13 Jun 2018 12:45:13 -0400 Received: from mx2.suse.de ([195.135.220.15]:35284 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934619AbeFMQpM (ORCPT ); Wed, 13 Jun 2018 12:45:12 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id BB81FACA1; Wed, 13 Jun 2018 16:45:10 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id DF40D1E0D63; Wed, 13 Jun 2018 18:45:09 +0200 (CEST) Date: Wed, 13 Jun 2018 18:45:09 +0200 From: Jan Kara To: Linus Torvalds Cc: Tetsuo Handa , Jan Kara , Tejun Heo , Dmitry Vyukov , Jens Axboe , syzbot+4a7438e774b21ddd8eca@syzkaller.appspotmail.com, syzkaller-bugs@googlegroups.com, linux-fsdevel , Linux Kernel Mailing List , Al Viro , Dave Chinner , linux-block Subject: Re: [PATCH] bdi: Fix another oops in wb_workfn() Message-ID: <20180613164509.oeb3fsjylfpfzxuh@quack2.suse.cz> References: <3cf4b0e3-31b6-8cdc-7c1e-15ba575a7879@i-love.sakura.ne.jp> <20180611091248.2i6nt27h5mxrodm2@quack2.suse.cz> <20180611160131.GQ1351649@devbig577.frc2.facebook.com> <20180611162920.mwapvuqotvhkntt3@quack2.suse.cz> <20180611172053.GR1351649@devbig577.frc2.facebook.com> <20180612155754.x5k2yndh5t6wlmpy@quack2.suse.cz> <20180613144606.nvbcyg2rdjpxhf7s@quack2.suse.cz> <7f4ae045-dfe4-6677-7418-f6f60b6c26f1@i-love.sakura.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 13-06-18 09:25:03, Linus Torvalds wrote: > On Wed, Jun 13, 2018 at 9:21 AM Tetsuo Handa > wrote: > > > > Since multiple addresses share bit_wait_table[256], isn't it possible that > > cgwb_start_shutdown() prematurely returns false due to wake_up_bit() by > > hash-conflicting addresses (i.e. not limited to clear_and_wake_up_bit() from > > wb_shutdown())? I think that we cannot be sure without confirming that > > test_bit(WB_shutting_down, &wb->state) == false after returning from schedule(). > > Right. > > That's _always_ true, btw. Something else entirely could have woken > you up. TASK_UNINTERRUPTIBLE does not mean "nothing else wakes me", it > just means "_signals_ don't wake me". > > So every single sleep always needs to be in a loop. Always. Agreed and in my patch it actually is in a loop - the one iterating the list of active writeback structures. If we get a false wakeup, we find the same structure in the list again and wait again... Honza -- Jan Kara SUSE Labs, CR