From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 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: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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