diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2017-11-01 12:27:24 -0800 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2018-03-06 15:27:07 -0500 |
commit | 3aea396177e695a91bb54001491a5580a7f3ad42 (patch) | |
tree | a851b22c100db61548784ca27fbe175def44db33 | |
parent | fd4ade39010e51f394be3ae017c6fa19ad8f8897 (diff) |
bcachefs: rework fallocate XXX broken
-rw-r--r-- | fs/bcachefs/fs-io.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c index 1860c97fefa9..750913a94e3f 100644 --- a/fs/bcachefs/fs-io.c +++ b/fs/bcachefs/fs-io.c @@ -2246,6 +2246,18 @@ static long bch2_fallocate(struct bch_inode_info *inode, int mode, block_start = round_up(offset, PAGE_SIZE); block_end = round_down(end, PAGE_SIZE); +#if 0 + truncate_pagecache_range(&inode->v, offset, end - 1); + do { + ret = invalidate_inode_pages2_range(mapping, + block_start >> PAGE_SHIFT, + block_end >> PAGE_SHIFT); + } while (ret == -EBUSY); + if (unlikely(ret)) + goto err_put_pagecache; + if (block_start < block_end) + truncate_pagecache_range(&inode->v, block_start, block_end - 1); +#endif } else { block_start = round_down(offset, PAGE_SIZE); block_end = round_up(end, PAGE_SIZE); |