Re: [BUG] Oops in inode_to_bdi()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux