On Fri, Jun 11, 2021 at 08:11:41PM -0400, Jeff Layton wrote: > if ((pos_in_page == 0 && len == PAGE_SIZE) || > - (pos >= i_size_read(inode)) || > + (index > (i_size_read(inode) - 1) / PAGE_SIZE) || > (pos_in_page == 0 && (pos + len) >= i_size_read(inode))) { You missed the (i_size == 0) case. And I really would factor out reading i_size into a local variable. > zero_user_segments(page, 0, pos_in_page, > pos_in_page + len, PAGE_SIZE); > -- > 2.31.1 > -- Linux-cachefs mailing list Linux-cachefs@xxxxxxxxxx https://listman.redhat.com/mailman/listinfo/linux-cachefs