提交 49792c80 编写于 作者: D Dmitry Monakhov 提交者: Jan Kara

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: NDmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: NJan Kara <jack@suse.cz>
上级 7eb4969e
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册