Unverified Commit 906d8cda authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!11348 v2 ext4: sanity check for NULL pointer after ext4_force_shutdown

parents 9b487350 6f1d3f63
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2070,6 +2070,9 @@ static int __block_commit_write(struct inode *inode, struct page *page,
	unsigned blocksize;
	struct buffer_head *bh, *head;

	if (!page_has_buffers(page))
		return 0;

	bh = head = page_buffers(page);
	blocksize = bh->b_size;

+5 −0
Original line number Diff line number Diff line
@@ -3089,6 +3089,11 @@ static int ext4_da_do_write_end(struct address_space *mapping,
	bool disksize_changed = false;
	loff_t new_i_size;

	if (unlikely(!page_has_buffers(page))) {
		unlock_page(page);
		put_page(page);
		return -EIO;
	}
	/*
	 * block_write_end() will mark the inode as dirty with I_DIRTY_PAGES
	 * flag, which all that's needed to trigger page writeback.