diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2016-02-04 18:34:49 -0900 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2017-01-18 21:37:39 -0900 |
commit | 0ac45c122460fa556599e6c996293ceeb2d241f0 (patch) | |
tree | fc390acf3d434f393ee173562c15bf94261e637b | |
parent | c8dae06aa45152da71383998bb9fdf0370cc25e9 (diff) |
bcachefs: skip existing reservations in fallocate
-rw-r--r-- | drivers/md/bcache/fs-io.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/md/bcache/fs-io.c b/drivers/md/bcache/fs-io.c index ea72b4f11b00..654567ccaae1 100644 --- a/drivers/md/bcache/fs-io.c +++ b/drivers/md/bcache/fs-io.c @@ -1357,6 +1357,7 @@ out: static int __bch_truncate_page(struct address_space *mapping, pgoff_t index, loff_t start, loff_t end) { + struct inode *inode = mapping->host; unsigned start_offset = start & (PAGE_SIZE - 1); unsigned end_offset = ((end - 1) & (PAGE_SIZE - 1)) + 1; struct page *page; @@ -1758,6 +1759,12 @@ static long bch_fallocate(struct inode *inode, int mode, goto err; } + /* already reserved */ + if (k.k->type == BCH_RESERVATION) { + bch_btree_iter_advance_pos(&iter); + continue; + } + if (bkey_extent_is_data(k.k)) { if (!(mode & FALLOC_FL_ZERO_RANGE)) { bch_btree_iter_advance_pos(&iter); |