===================================================================
@@ -2507,14 +2507,6 @@ static ssize_t shmem_file_read_iter(stru
ssize_t retval = 0;
loff_t *ppos = &iocb->ki_pos;
- /*
- * Might this read be for a stacking filesystem? Then when reading
- * holes of a sparse file, we actually need to allocate those pages,
- * and even mark them dirty, so it cannot exceed the max_blocks limit.
- */
- if (!iter_is_iovec(to))
- sgp = SGP_CACHE;
-
index = *ppos >> PAGE_SHIFT;
offset = *ppos & ~PAGE_MASK;
Hi Do we still need the patch a0ee5ec520ede? We are using the loop device for testing and when we read something from the loop device, it allocates the pages on the underlying shmfs filesystem. See this example: # mkdir -p /mnt/test # mount -t tmpfs /dev/null /mnt/test # cd /mnt/test # truncate -s 1GiB file # du -hs file 0 file # losetup /dev/loop0 file # du -hs file 1,1M file # dd if=/dev/loop0 of=/dev/null 2097152+0 zĂĄznamĹŻ pĹeÄteno 2097152+0 zĂĄznamĹŻ zapsĂĄno 1073741824 bajtĹŻ (1,1 GB, 1,0 GiB) zkopĂrovĂĄno, 4,06865 s, 264 MB/s # du -hs file 1,0G file This patch turns off the allocation on read. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> --- mm/shmem.c | 8 -------- 1 file changed, 8 deletions(-)