diff options
-rw-r--r-- | fs/f2fs/data.c | 2 | ||||
-rw-r--r-- | fs/f2fs/file.c | 7 | ||||
-rw-r--r-- | fs/f2fs/gc.c | 7 | ||||
-rw-r--r-- | fs/f2fs/inline.c | 2 | ||||
-rw-r--r-- | fs/f2fs/segment.c | 1 |
5 files changed, 13 insertions, 6 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 9bedfa8dd3a5..f71e19a9dd3c 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c | |||
@@ -2072,8 +2072,6 @@ static int f2fs_set_data_page_dirty(struct page *page) | |||
2072 | return 1; | 2072 | return 1; |
2073 | } | 2073 | } |
2074 | 2074 | ||
2075 | mark_inode_dirty(inode); | ||
2076 | |||
2077 | if (!PageDirty(page)) { | 2075 | if (!PageDirty(page)) { |
2078 | __set_page_dirty_nobuffers(page); | 2076 | __set_page_dirty_nobuffers(page); |
2079 | update_dirty_page(inode, page); | 2077 | update_dirty_page(inode, page); |
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index ada2a3dd701a..b0f38c3b37f4 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c | |||
@@ -1331,12 +1331,13 @@ static int f2fs_ioc_commit_atomic_write(struct file *filp) | |||
1331 | if (ret) | 1331 | if (ret) |
1332 | return ret; | 1332 | return ret; |
1333 | 1333 | ||
1334 | if (f2fs_is_atomic_file(inode)) | 1334 | if (f2fs_is_atomic_file(inode)) { |
1335 | clear_inode_flag(F2FS_I(inode), FI_ATOMIC_FILE); | ||
1335 | commit_inmem_pages(inode, false); | 1336 | commit_inmem_pages(inode, false); |
1337 | } | ||
1336 | 1338 | ||
1337 | ret = f2fs_sync_file(filp, 0, LONG_MAX, 0); | 1339 | ret = f2fs_sync_file(filp, 0, LONG_MAX, 0); |
1338 | mnt_drop_write_file(filp); | 1340 | mnt_drop_write_file(filp); |
1339 | clear_inode_flag(F2FS_I(inode), FI_ATOMIC_FILE); | ||
1340 | return ret; | 1341 | return ret; |
1341 | } | 1342 | } |
1342 | 1343 | ||
@@ -1387,8 +1388,8 @@ static int f2fs_ioc_abort_volatile_write(struct file *filp) | |||
1387 | f2fs_balance_fs(F2FS_I_SB(inode)); | 1388 | f2fs_balance_fs(F2FS_I_SB(inode)); |
1388 | 1389 | ||
1389 | if (f2fs_is_atomic_file(inode)) { | 1390 | if (f2fs_is_atomic_file(inode)) { |
1390 | commit_inmem_pages(inode, false); | ||
1391 | clear_inode_flag(F2FS_I(inode), FI_ATOMIC_FILE); | 1391 | clear_inode_flag(F2FS_I(inode), FI_ATOMIC_FILE); |
1392 | commit_inmem_pages(inode, false); | ||
1392 | } | 1393 | } |
1393 | 1394 | ||
1394 | if (f2fs_is_volatile_file(inode)) | 1395 | if (f2fs_is_volatile_file(inode)) |
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 883a841dfc6d..22fb5ef37966 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c | |||
@@ -568,6 +568,11 @@ static void move_encrypted_block(struct inode *inode, block_t bidx) | |||
568 | if (unlikely(fio.encrypted_page->mapping != META_MAPPING(fio.sbi))) | 568 | if (unlikely(fio.encrypted_page->mapping != META_MAPPING(fio.sbi))) |
569 | goto put_page_out; | 569 | goto put_page_out; |
570 | 570 | ||
571 | set_page_dirty(fio.encrypted_page); | ||
572 | f2fs_wait_on_page_writeback(fio.encrypted_page, META); | ||
573 | if (clear_page_dirty_for_io(fio.encrypted_page)) | ||
574 | dec_page_count(fio.sbi, F2FS_DIRTY_META); | ||
575 | |||
571 | set_page_writeback(fio.encrypted_page); | 576 | set_page_writeback(fio.encrypted_page); |
572 | 577 | ||
573 | /* allocate block address */ | 578 | /* allocate block address */ |
@@ -612,8 +617,8 @@ static void move_data_page(struct inode *inode, block_t bidx, int gc_type) | |||
612 | .page = page, | 617 | .page = page, |
613 | .encrypted_page = NULL, | 618 | .encrypted_page = NULL, |
614 | }; | 619 | }; |
620 | set_page_dirty(page); | ||
615 | f2fs_wait_on_page_writeback(page, DATA); | 621 | f2fs_wait_on_page_writeback(page, DATA); |
616 | |||
617 | if (clear_page_dirty_for_io(page)) | 622 | if (clear_page_dirty_for_io(page)) |
618 | inode_dec_dirty_pages(inode); | 623 | inode_dec_dirty_pages(inode); |
619 | set_cold_data(page); | 624 | set_cold_data(page); |
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c index 38e75fb1e488..a13ffcc32992 100644 --- a/fs/f2fs/inline.c +++ b/fs/f2fs/inline.c | |||
@@ -141,6 +141,8 @@ int f2fs_convert_inline_page(struct dnode_of_data *dn, struct page *page) | |||
141 | kunmap_atomic(dst_addr); | 141 | kunmap_atomic(dst_addr); |
142 | SetPageUptodate(page); | 142 | SetPageUptodate(page); |
143 | no_update: | 143 | no_update: |
144 | set_page_dirty(page); | ||
145 | |||
144 | /* clear dirty state */ | 146 | /* clear dirty state */ |
145 | dirty = clear_page_dirty_for_io(page); | 147 | dirty = clear_page_dirty_for_io(page); |
146 | 148 | ||
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 1eb343768781..61b97f9cb9f6 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c | |||
@@ -257,6 +257,7 @@ void commit_inmem_pages(struct inode *inode, bool abort) | |||
257 | if (!abort) { | 257 | if (!abort) { |
258 | lock_page(cur->page); | 258 | lock_page(cur->page); |
259 | if (cur->page->mapping == inode->i_mapping) { | 259 | if (cur->page->mapping == inode->i_mapping) { |
260 | set_page_dirty(cur->page); | ||
260 | f2fs_wait_on_page_writeback(cur->page, DATA); | 261 | f2fs_wait_on_page_writeback(cur->page, DATA); |
261 | if (clear_page_dirty_for_io(cur->page)) | 262 | if (clear_page_dirty_for_io(cur->page)) |
262 | inode_dec_dirty_pages(inode); | 263 | inode_dec_dirty_pages(inode); |