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

Commit 49792c80 authored by Dmitry Monakhov's avatar Dmitry Monakhov Committed by Jan Kara
Browse files

ext3: add writepage sanity checks



- There is theoretical possibility to perform writepage on
   RO superblock. Add explicit check for what case.
- Page must being locked before writepage.

Signed-off-by: default avatarDmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 7eb4969e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1528,6 +1528,7 @@ static int ext3_ordered_writepage(struct page *page,
	int err;

	J_ASSERT(PageLocked(page));
	WARN_ON_ONCE(IS_RDONLY(inode));

	/*
	 * We give up here if we're reentered, because it might be for a
@@ -1600,6 +1601,9 @@ static int ext3_writeback_writepage(struct page *page,
	int ret = 0;
	int err;

	J_ASSERT(PageLocked(page));
	WARN_ON_ONCE(IS_RDONLY(inode));

	if (ext3_journal_current_handle())
		goto out_fail;

@@ -1642,6 +1646,9 @@ static int ext3_journalled_writepage(struct page *page,
	int ret = 0;
	int err;

	J_ASSERT(PageLocked(page));
	WARN_ON_ONCE(IS_RDONLY(inode));

	if (ext3_journal_current_handle())
		goto no_write;