Commit 4de8514
f2fs: extend stat_lock to avoid potential race in statfs
There are multiple calculations and reads of fields of sbi that should
be protected by stat_lock. As stat_lock is not used to read these
values in statfs, this can lead to inconsistent results.
Extend the locking to prevent this issue.
Commit c9c8ed5 ("f2fs: fix to avoid potential race on
sbi->unusable_block_count access/update")
already added the use of sbi->stat_lock in statfs in
order to make the calculation of multiple, different fields atomic so
that results are consistent. This is similar to that patch regarding the
change in statfs.
Signed-off-by: Niels Dossche <dossche.niels@gmail.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>1 parent a7b8618 commit 4de8514
1 file changed
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1707 | 1707 | | |
1708 | 1708 | | |
1709 | 1709 | | |
| 1710 | + | |
1710 | 1711 | | |
1711 | 1712 | | |
1712 | | - | |
1713 | 1713 | | |
1714 | 1714 | | |
1715 | 1715 | | |
1716 | 1716 | | |
1717 | 1717 | | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
1718 | 1724 | | |
1719 | 1725 | | |
1720 | 1726 | | |
1721 | | - | |
1722 | 1727 | | |
1723 | 1728 | | |
1724 | 1729 | | |
| |||
1731 | 1736 | | |
1732 | 1737 | | |
1733 | 1738 | | |
1734 | | - | |
1735 | | - | |
1736 | 1739 | | |
1737 | 1740 | | |
1738 | 1741 | | |
1739 | 1742 | | |
1740 | 1743 | | |
1741 | | - | |
| 1744 | + | |
1742 | 1745 | | |
1743 | 1746 | | |
1744 | 1747 | | |
| |||
0 commit comments