Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp762073imm; Wed, 13 Jun 2018 07:56:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIcsi6XkysN1qV1rL6CZf6+ILYNOffg/mcT4L0ekTyhoZj6lCeznDxUUIkBTICQAgVnJdFM X-Received: by 2002:a62:81c5:: with SMTP id t188-v6mr5280644pfd.146.1528901792371; Wed, 13 Jun 2018 07:56:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528901792; cv=none; d=google.com; s=arc-20160816; b=RfgbUV3GwCLeQ9BpbIIKgcKXZGiUh2FcfiZwAa43KBrs0rXSOpGwjJ38uG/rmKdd/k rxxBt7UJ+yEcVEy3HdgnCZ/ixKuJS1LHAF1jhkHaxSij5EROgxSnNIoGL9Xwfj0Y7Eit piQySiiDPiMhlG1ZeH+ECCDLbywDefLs3bZ43Ae7T6BcJqNWDD5rRtdxYtvIfcniRXW0 tg3aMQrqjq7sS+0ZzZuiWGrFKe/OSd2FshZBBJMT29781cQOojBYxecnTC95mkU9tsTO +eZrZK+iK55RE6GnhQN0a7g2js1E+oqjcpJ22KYIi7RziIy92oD5kfqqaO94qudRT31r Rdwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=0ItRmEdnhylmdKeV4H7Os6lQn+0f7Cyy0O9X9R+PiIY=; b=nbGdhUc471THLD5SpUYwU36rcaS80asHIIlszpKcWPKFQZCLwUlAVieuxIIzQ/oE7D RDbDEdTGV0uL6L4KJdTJ4QSFNkRw3/spgCZrhS3xXYPeXSejjy9rKhQpmtogABpcXmPM JOhbmRay9pLaXu/jAfKV+Ah5jjSb80sbJ/hXlqmNr01KBUMeiknXMJp7c5FM+9WuW8Jh 4HC+FOtY+iQ0KmICiu+AA/fQNWxIFrukVPuaH0BAapEicwbMTaVQdVDl7QH8pK32CMV/ ADr21eb6lmSF/fjlevQWmkNhfQYyR1aGJdixOLECRBr0Q9EF7GlUAgezygknAnJrQZG9 WjDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=MBawlPYA; 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 q12-v6si2424961pgn.377.2018.06.13.07.56.17; Wed, 13 Jun 2018 07:56:32 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=MBawlPYA; 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 S935733AbeFMOzr (ORCPT + 99 others); Wed, 13 Jun 2018 10:55:47 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:36617 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935190AbeFMOzo (ORCPT ); Wed, 13 Jun 2018 10:55:44 -0400 Received: by mail-it0-f67.google.com with SMTP id j135-v6so4280605itj.1; Wed, 13 Jun 2018 07:55:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0ItRmEdnhylmdKeV4H7Os6lQn+0f7Cyy0O9X9R+PiIY=; b=MBawlPYAWkLzg5ZCx+QvRw78upEtrkWDrkBbUcI4yDlWKzAlrBV7+djiALCrww6sOc ZbZcvQj54ZsV//34Xyg3t/3OpHilfWgJipXxQukz4cTtzIiylvovyC4JIAywLmHnShPx +t1GoGletrDGKFBi45WP/RnNTEoj/dBnDZw1Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0ItRmEdnhylmdKeV4H7Os6lQn+0f7Cyy0O9X9R+PiIY=; b=gCx0I0lD4Ye7gWi4uekhFRKAMna52SapQOJs3i4/RVfp6qNttzpCX1ag3FCUfDO6IE l/vlaBuGtWa/eOZG02GnPIMtbZTbNZr8sSNbFY9BrrPfrQ1yjbTY3nVZf/SKNXjdzyWc BrAU0Ub7glujDCe6I+CK1Yh615orbTwJdJ1ZJPait8Nli84QV1sp/cIeWAxoE8fATqEq WyX8e+/rh9E75cbc7/wynzoCZ0WLCUyB7ypTrcU55sCQpjAmdqAvrFhesjOEEkHITpEp qpBFA3Ey18xVsxJcsL50ZoSXKid6k4H8ysJO2eRIdWwJTA5Luw54BcZ0oRaLmZ0PdLH6 qvug== X-Gm-Message-State: APt69E3AZcNzVYFKsng/wBgl/bPGxA9/UX2WPVbBs7JP2rVx9K6/cVoi W6SKRNlggBLRwG6lin60Ehn0iofb2SuMGdhX0Y4= X-Received: by 2002:a24:5b81:: with SMTP id g123-v6mr4825865itb.1.1528901744036; Wed, 13 Jun 2018 07:55:44 -0700 (PDT) MIME-Version: 1.0 References: <2b437c6f-3e10-3d83-bdf3-82075d3eaa1a@i-love.sakura.ne.jp> <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> In-Reply-To: <20180613144606.nvbcyg2rdjpxhf7s@quack2.suse.cz> From: Linus Torvalds Date: Wed, 13 Jun 2018 07:55:32 -0700 Message-ID: Subject: Re: [PATCH] bdi: Fix another oops in wb_workfn() To: Jan Kara Cc: Tetsuo Handa , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 13, 2018 at 7:46 AM Jan Kara wrote: > > On Wed 13-06-18 19:43:47, Tetsuo Handa wrote: > > Can't we utilize RCU grace period (like shown below) ? > > Honestly, the variant 1 looks too ugly to me. However variant 2 looks > mostly OK. The versions that don't have that conditional locking look fine to me, yes. > Also I'd avoid the addition argument to wb_writeback() and split the function instead. The > patch resulting from your and mine ideas is attached. Thoughts? Is there a reason for this model: + if (cgwb_start_shutdown(wb)) + __wb_shutdown(wb); when there is just one call site of this? Why not just make the function void, and make it do that __wb_shutdown() itself in the true case? IOW, just make it be + cgwb_shutdown(wb); instead? That's what "wb_shutdown()" does - it does the "wb_start_shutdown()" test internally, and does __wb_shutdown() all inside itself, instead of expecting the caller to do it. I dunno. Linus Linus