diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-05-20 15:49:23 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:04 -0400 |
commit | a6336910b1c30703fe0d5078ef1c656ea1d39096 (patch) | |
tree | 686bd59532ad256f9ee1f7c255f84a6a22853208 /fs/bcachefs/io.h | |
parent | 16ac8c9523a2744545bb773b41433a5007deeacb (diff) | |
download | linux-stable-a6336910b1c30703fe0d5078ef1c656ea1d39096.tar.gz linux-stable-a6336910b1c30703fe0d5078ef1c656ea1d39096.tar.bz2 linux-stable-a6336910b1c30703fe0d5078ef1c656ea1d39096.zip |
bcachefs: Fix for buffered writes getting -ENOSPC
Buffered writes may have to increase their disk reservation at btree
update time, due to compression and erasure coding being unpredictable:
O_DIRECT writes should be checking for -ENOSPC, but buffered writes have
already been accepted and should not.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/io.h')
-rw-r--r-- | fs/bcachefs/io.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/bcachefs/io.h b/fs/bcachefs/io.h index ccbd8c3e6642..d1fd37ef2fc0 100644 --- a/fs/bcachefs/io.h +++ b/fs/bcachefs/io.h @@ -38,11 +38,12 @@ enum bch_write_flags { BCH_WRITE_ONLY_SPECIFIED_DEVS = (1 << 6), BCH_WRITE_WROTE_DATA_INLINE = (1 << 7), BCH_WRITE_FROM_INTERNAL = (1 << 8), + BCH_WRITE_CHECK_ENOSPC = (1 << 9), /* Internal: */ - BCH_WRITE_JOURNAL_SEQ_PTR = (1 << 9), - BCH_WRITE_SKIP_CLOSURE_PUT = (1 << 10), - BCH_WRITE_DONE = (1 << 11), + BCH_WRITE_JOURNAL_SEQ_PTR = (1 << 10), + BCH_WRITE_SKIP_CLOSURE_PUT = (1 << 11), + BCH_WRITE_DONE = (1 << 12), }; static inline u64 *op_journal_seq(struct bch_write_op *op) @@ -68,7 +69,7 @@ int bch2_sum_sector_overwrites(struct btree_trans *, struct btree_iter *, struct bkey_i *, bool *, bool *, s64 *, s64 *); int bch2_extent_update(struct btree_trans *, struct btree_iter *, struct bkey_i *, struct disk_reservation *, - u64 *, u64, s64 *); + u64 *, u64, s64 *, bool); int bch2_fpunch_at(struct btree_trans *, struct btree_iter *, struct bpos, u64 *, s64 *); int bch2_fpunch(struct bch_fs *c, u64, u64, u64, u64 *, s64 *); |