linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@fb.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: <linux-fsdevel@vger.kernel.org>
Subject: Re: [BUG] Oops in inode_to_bdi()
Date: Wed, 21 Jan 2015 12:33:07 -0700	[thread overview]
Message-ID: <54BFFEF3.1070809@fb.com> (raw)
In-Reply-To: <20150121192949.GA24787@infradead.org>

[-- Attachment #1: Type: text/plain, Size: 494 bytes --]

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


[-- Attachment #2: inode-debug.patch --]
[-- Type: text/x-patch, Size: 507 bytes --]

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));

  reply	other threads:[~2015-01-21 19:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 19:17 [BUG] Oops in inode_to_bdi() Jens Axboe
2015-01-21 19:29 ` Christoph Hellwig
2015-01-21 19:33   ` Jens Axboe [this message]
2015-01-21 20:04     ` Jens Axboe
2015-01-24  1:22   ` Omar Sandoval

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54BFFEF3.1070809@fb.com \
    --to=axboe@fb.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).