aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r--fs/f2fs/data.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 03313099c51c..76de83e25a89 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -53,7 +53,7 @@ static void f2fs_write_end_io(struct bio *bio, int err)
53 struct page *page = bvec->bv_page; 53 struct page *page = bvec->bv_page;
54 54
55 if (unlikely(err)) { 55 if (unlikely(err)) {
56 SetPageError(page); 56 set_page_dirty(page);
57 set_bit(AS_EIO, &page->mapping->flags); 57 set_bit(AS_EIO, &page->mapping->flags);
58 f2fs_stop_checkpoint(sbi); 58 f2fs_stop_checkpoint(sbi);
59 } 59 }
@@ -691,7 +691,7 @@ get_next:
691 allocated = true; 691 allocated = true;
692 blkaddr = dn.data_blkaddr; 692 blkaddr = dn.data_blkaddr;
693 } 693 }
694 /* Give more consecutive addresses for the read ahead */ 694 /* Give more consecutive addresses for the readahead */
695 if (blkaddr == (bh_result->b_blocknr + ofs)) { 695 if (blkaddr == (bh_result->b_blocknr + ofs)) {
696 ofs++; 696 ofs++;
697 dn.ofs_in_node++; 697 dn.ofs_in_node++;
@@ -739,7 +739,7 @@ static int f2fs_read_data_page(struct file *file, struct page *page)
739 739
740 trace_f2fs_readpage(page, DATA); 740 trace_f2fs_readpage(page, DATA);
741 741
742 /* If the file has inline data, try to read it directlly */ 742 /* If the file has inline data, try to read it directly */
743 if (f2fs_has_inline_data(inode)) 743 if (f2fs_has_inline_data(inode))
744 ret = f2fs_read_inline_data(inode, page); 744 ret = f2fs_read_inline_data(inode, page);
745 else 745 else
@@ -836,10 +836,19 @@ write:
836 836
837 /* Dentry blocks are controlled by checkpoint */ 837 /* Dentry blocks are controlled by checkpoint */
838 if (S_ISDIR(inode->i_mode)) { 838 if (S_ISDIR(inode->i_mode)) {
839 if (unlikely(f2fs_cp_error(sbi)))
840 goto redirty_out;
839 err = do_write_data_page(page, &fio); 841 err = do_write_data_page(page, &fio);
840 goto done; 842 goto done;
841 } 843 }
842 844
845 /* we should bypass data pages to proceed the kworkder jobs */
846 if (unlikely(f2fs_cp_error(sbi))) {
847 SetPageError(page);
848 unlock_page(page);
849 return 0;
850 }
851
843 if (!wbc->for_reclaim) 852 if (!wbc->for_reclaim)
844 need_balance_fs = true; 853 need_balance_fs = true;
845 else if (has_not_enough_free_secs(sbi, 0)) 854 else if (has_not_enough_free_secs(sbi, 0))
@@ -927,7 +936,7 @@ static void f2fs_write_failed(struct address_space *mapping, loff_t to)
927 936
928 if (to > inode->i_size) { 937 if (to > inode->i_size) {
929 truncate_pagecache(inode, inode->i_size); 938 truncate_pagecache(inode, inode->i_size);
930 truncate_blocks(inode, inode->i_size); 939 truncate_blocks(inode, inode->i_size, true);
931 } 940 }
932} 941}
933 942
@@ -946,7 +955,7 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping,
946 955
947 f2fs_balance_fs(sbi); 956 f2fs_balance_fs(sbi);
948repeat: 957repeat:
949 err = f2fs_convert_inline_data(inode, pos + len); 958 err = f2fs_convert_inline_data(inode, pos + len, NULL);
950 if (err) 959 if (err)
951 goto fail; 960 goto fail;
952 961