Re: [PATCH 12/16] romfs: Convert romfs_read_folio() to use a folio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 12/8/24 13:30, Matthew Wilcox wrote:
On Mon, Aug 12, 2024 at 11:46:34AM +1000, Greg Ungerer wrote:
@@ -125,20 +121,14 @@ static int romfs_read_folio(struct file *file, struct folio *folio)
   		ret = romfs_dev_read(inode->i_sb, pos, buf, fillsize);
   		if (ret < 0) {
-			SetPageError(page);
   			fillsize = 0;
   			ret = -EIO;
   		}
   	}
-	if (fillsize < PAGE_SIZE)
-		memset(buf + fillsize, 0, PAGE_SIZE - fillsize);
-	if (ret == 0)
-		SetPageUptodate(page);
-
-	flush_dcache_page(page);
-	kunmap(page);
-	unlock_page(page);
+	buf = folio_zero_tail(folio, fillsize, buf);

I think this should have been:

	buf = folio_zero_tail(folio, fillsize, buf + fillsize);

Can you give that a try?

Yep, that fixes it.

Thanks
Greg






[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux