I found that bchfs_fallocate() only evicts pagecache when FALLOC_FL_ZERO_RANGE 
is set:

if (mode & FALLOC_FL_ZERO_RANGE) {
    ret = bch2_truncate_folios(inode, offset, end);
    truncate_pagecache_range(&inode->v, offset, end - 1);
}

So basic fallocate (mode=0 or just KEEP_SIZE) doesn't evict pages and shouldn't 
need pagecache_block_get().

Should the fix be to only acquire pagecache_block_get() for modes that actually 
evict (ZERO_RANGE, PUNCH_HOLE, INSERT/COLLAPSE)?


Reply via email to