diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-11-22 06:34:26 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:17 +0300 |
commit | 8810386f6bd55cf3287a1219901c2993b3bac959 (patch) | |
tree | 69e560f281de02b316c5ba00e61c54406bc1dffc /fs/bcachefs/fs-io.c | |
parent | 7468c4effc8c93464ec0fd4336494312bebb8033 (diff) | |
download | linux-8810386f6bd55cf3287a1219901c2993b3bac959.tar.xz |
bcachefs: Fix an i_sectors accounting bug
We weren't checking for errors before calling i_sectors_acct()
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/fs-io.c')
-rw-r--r-- | fs/bcachefs/fs-io.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c index ac013bb99a43..dff6d7547212 100644 --- a/fs/bcachefs/fs-io.c +++ b/fs/bcachefs/fs-io.c @@ -2806,6 +2806,8 @@ static int __bchfs_fallocate(struct bch_inode_info *inode, int mode, &reservation.k_i, &disk_res, NULL, 0, &i_sectors_delta, true); + if (ret) + goto bkey_err; i_sectors_acct(c, inode, "a_res, i_sectors_delta); bkey_err: bch2_quota_reservation_put(c, inode, "a_res); |