Commit 0a4ed2d
f2fs: compress: fix to cover {reserve,release}_compress_blocks() w/ cp_rwsem lock
It needs to cover {reserve,release}_compress_blocks() w/ cp_rwsem lock
to avoid racing with checkpoint, otherwise, filesystem metadata including
blkaddr in dnode, inode fields and .total_valid_block_count may be
corrupted after SPO case.
Fixes: ef8d563 ("f2fs: introduce F2FS_IOC_RELEASE_COMPRESS_BLOCKS")
Fixes: c75488f ("f2fs: introduce F2FS_IOC_RESERVE_COMPRESS_BLOCKS")
Signed-off-by: Chao Yu <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>1 parent 043c832 commit 0a4ed2d
1 file changed
+10
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3593 | 3593 | | |
3594 | 3594 | | |
3595 | 3595 | | |
| 3596 | + | |
| 3597 | + | |
3596 | 3598 | | |
3597 | 3599 | | |
3598 | 3600 | | |
| 3601 | + | |
3599 | 3602 | | |
3600 | 3603 | | |
3601 | 3604 | | |
| |||
3613 | 3616 | | |
3614 | 3617 | | |
3615 | 3618 | | |
| 3619 | + | |
| 3620 | + | |
3616 | 3621 | | |
3617 | 3622 | | |
3618 | 3623 | | |
| |||
3765 | 3770 | | |
3766 | 3771 | | |
3767 | 3772 | | |
| 3773 | + | |
| 3774 | + | |
3768 | 3775 | | |
3769 | 3776 | | |
3770 | 3777 | | |
| 3778 | + | |
3771 | 3779 | | |
3772 | 3780 | | |
3773 | 3781 | | |
| |||
3785 | 3793 | | |
3786 | 3794 | | |
3787 | 3795 | | |
| 3796 | + | |
| 3797 | + | |
3788 | 3798 | | |
3789 | 3799 | | |
3790 | 3800 | | |
| |||
0 commit comments