diff options
-rw-r--r-- | fs/ext4/ext4_jbd2.h | 4 | ||||
-rw-r--r-- | fs/ext4/inode.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/fs/ext4/ext4_jbd2.h b/fs/ext4/ext4_jbd2.h index bb85757689b..5802fa1dab1 100644 --- a/fs/ext4/ext4_jbd2.h +++ b/fs/ext4/ext4_jbd2.h | |||
@@ -289,10 +289,10 @@ static inline int ext4_should_order_data(struct inode *inode) | |||
289 | 289 | ||
290 | static inline int ext4_should_writeback_data(struct inode *inode) | 290 | static inline int ext4_should_writeback_data(struct inode *inode) |
291 | { | 291 | { |
292 | if (!S_ISREG(inode->i_mode)) | ||
293 | return 0; | ||
294 | if (EXT4_JOURNAL(inode) == NULL) | 292 | if (EXT4_JOURNAL(inode) == NULL) |
295 | return 1; | 293 | return 1; |
294 | if (!S_ISREG(inode->i_mode)) | ||
295 | return 0; | ||
296 | if (ext4_test_inode_flag(inode, EXT4_INODE_JOURNAL_DATA)) | 296 | if (ext4_test_inode_flag(inode, EXT4_INODE_JOURNAL_DATA)) |
297 | return 0; | 297 | return 0; |
298 | if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_WRITEBACK_DATA) | 298 | if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_WRITEBACK_DATA) |
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index d47264cafee..ad3a7ca2106 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -983,6 +983,8 @@ static int ext4_journalled_write_end(struct file *file, | |||
983 | from = pos & (PAGE_CACHE_SIZE - 1); | 983 | from = pos & (PAGE_CACHE_SIZE - 1); |
984 | to = from + len; | 984 | to = from + len; |
985 | 985 | ||
986 | BUG_ON(!ext4_handle_valid(handle)); | ||
987 | |||
986 | if (copied < len) { | 988 | if (copied < len) { |
987 | if (!PageUptodate(page)) | 989 | if (!PageUptodate(page)) |
988 | copied = 0; | 990 | copied = 0; |
@@ -1699,6 +1701,8 @@ static int __ext4_journalled_writepage(struct page *page, | |||
1699 | goto out; | 1701 | goto out; |
1700 | } | 1702 | } |
1701 | 1703 | ||
1704 | BUG_ON(!ext4_handle_valid(handle)); | ||
1705 | |||
1702 | ret = walk_page_buffers(handle, page_bufs, 0, len, NULL, | 1706 | ret = walk_page_buffers(handle, page_bufs, 0, len, NULL, |
1703 | do_journal_get_write_access); | 1707 | do_journal_get_write_access); |
1704 | 1708 | ||