From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752438AbdCBMGr (ORCPT ); Thu, 2 Mar 2017 07:06:47 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:39764 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751895AbdCBMGm (ORCPT ); Thu, 2 Mar 2017 07:06:42 -0500 Date: Thu, 2 Mar 2017 11:44:53 +0000 From: Al Viro To: Jan Kara Cc: Dmitry Vyukov , "linux-fsdevel@vger.kernel.org" , LKML , Jens Axboe , Andrew Morton , Tejun Heo , Johannes Weiner , "linux-mm@kvack.org" , Andrey Ryabinin , syzkaller Subject: Re: mm: GPF in bdi_put Message-ID: <20170302114453.GX29622@ZenIV.linux.org.uk> References: <20170227182755.GR29622@ZenIV.linux.org.uk> <20170301142909.GG20512@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170301142909.GG20512@quack2.suse.cz> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 01, 2017 at 03:29:09PM +0100, Jan Kara wrote: > The problem is writeback code (from flusher work or through sync(2) - > generally inode_to_bdi() users) can be looking at bdev inode independently > from it being open. So if they start looking while the bdev is open but the > dereference happens after it is closed and device removed, we oops. We have > seen oopses due to this for quite a while. And all the stuff that is done > in __blkdev_put() is not enough to prevent writeback code from having a > look whether there is not something to write. Um. What's to prevent the queue/device/module itself from disappearing from under you? IOW, what are you doing that is safe to do in face of driver going rmmoded?