From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Axboe Subject: Re: [BUG] Oops in inode_to_bdi() Date: Wed, 21 Jan 2015 12:33:07 -0700 Message-ID: <54BFFEF3.1070809@fb.com> References: <20150121191707.GA27823@kernel.dk> <20150121192949.GA24787@infradead.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040802020804020202090401" Cc: To: Christoph Hellwig Return-path: Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:44390 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754053AbbAUTdb (ORCPT ); Wed, 21 Jan 2015 14:33:31 -0500 In-Reply-To: <20150121192949.GA24787@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: --------------040802020804020202090401 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit On 01/21/2015 12:29 PM, Christoph Hellwig wrote: > On Wed, Jan 21, 2015 at 12:17:07PM -0700, Jens Axboe wrote: >> Christoph, >> >> Ran into this one while testing. Looks like mapping->host is NULL, off >> the shmem_writepage(). > > Hmm. Not sure how this can happen, but for a NULL inode we can > always just return noop_backing_dev_info safely, I'll cook up a patch. I got 8 of them in a row. Current kernel is running with the attached, just to see if I can reproduce it. -- Jens Axboe --------------040802020804020202090401 Content-Type: text/x-patch; name="inode-debug.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="inode-debug.patch" diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index a20b1145f4d5..4f03e33365e1 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -68,7 +68,12 @@ EXPORT_SYMBOL(writeback_in_progress); struct backing_dev_info *inode_to_bdi(struct inode *inode) { - struct super_block *sb = inode->i_sb; + struct super_block *sb; + + if (WARN_ON(!inode)) + return &noop_backing_dev_info; + + sb = inode->i_sb; #ifdef CONFIG_BLOCK if (sb_is_blkdev_sb(sb)) return blk_get_backing_dev_info(I_BDEV(inode)); --------------040802020804020202090401--