diff options
-rw-r--r-- | fs/f2fs/file.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 54722a0a5be5..edc3ce867e9c 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c | |||
@@ -477,8 +477,6 @@ int truncate_blocks(struct inode *inode, u64 from, bool lock) | |||
477 | } | 477 | } |
478 | 478 | ||
479 | if (f2fs_has_inline_data(inode)) { | 479 | if (f2fs_has_inline_data(inode)) { |
480 | truncate_inline_data(ipage, from); | ||
481 | update_inode(inode, ipage); | ||
482 | f2fs_put_page(ipage, 1); | 480 | f2fs_put_page(ipage, 1); |
483 | goto out; | 481 | goto out; |
484 | } | 482 | } |
@@ -504,13 +502,13 @@ int truncate_blocks(struct inode *inode, u64 from, bool lock) | |||
504 | f2fs_put_dnode(&dn); | 502 | f2fs_put_dnode(&dn); |
505 | free_next: | 503 | free_next: |
506 | err = truncate_inode_blocks(inode, free_from); | 504 | err = truncate_inode_blocks(inode, free_from); |
505 | out: | ||
506 | if (lock) | ||
507 | f2fs_unlock_op(sbi); | ||
507 | 508 | ||
508 | /* lastly zero out the first data page */ | 509 | /* lastly zero out the first data page */ |
509 | if (!err) | 510 | if (!err) |
510 | err = truncate_partial_data_page(inode, from); | 511 | err = truncate_partial_data_page(inode, from); |
511 | out: | ||
512 | if (lock) | ||
513 | f2fs_unlock_op(sbi); | ||
514 | 512 | ||
515 | trace_f2fs_truncate_blocks_exit(inode, err); | 513 | trace_f2fs_truncate_blocks_exit(inode, err); |
516 | return err; | 514 | return err; |