Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aedf62a2 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "block: Fix oops in locked_inode_to_wb_and_lock_list()"

parents 5954c329 365bb9cc
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -558,6 +558,8 @@ static void bdev_evict_inode(struct inode *inode)
	}
	list_del_init(&bdev->bd_list);
	spin_unlock(&bdev_lock);
	/* Detach inode from wb early as bdi_put() may free bdi->wb */
	inode_detach_wb(inode);
	if (bdev->bd_bdi != &noop_backing_dev_info) {
		bdi_put(bdev->bd_bdi);
		bdev->bd_bdi = &noop_backing_dev_info;
@@ -1547,12 +1549,6 @@ static void __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part)
		kill_bdev(bdev);

		bdev_write_inode(bdev);
		/*
		 * Detaching bdev inode from its wb in __destroy_inode()
		 * is too late: the queue which embeds its bdi (along with
		 * root wb) can be gone as soon as we put_disk() below.
		 */
		inode_detach_wb(bdev->bd_inode);
	}
	if (bdev->bd_contains == bdev) {
		if (disk->fops->release)
+1 −0
Original line number Diff line number Diff line
@@ -224,6 +224,7 @@ static inline void inode_attach_wb(struct inode *inode, struct page *page)
static inline void inode_detach_wb(struct inode *inode)
{
	if (inode->i_wb) {
		WARN_ON_ONCE(!(inode->i_state & I_CLEAR));
		wb_put(inode->i_wb);
		inode->i_wb = NULL;
	}