Re: [PATCH 1/2] shmem: implement user/group quota support for tmpfs

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

 



On Tue, Nov 08, 2022 at 02:30:09PM +0100, Lukas Czerner wrote:
> +	err = shmem_get_folio(inode, index, &folio, SGP_WRITE);
> +	if (err)
> +		return err;
> +
> +	page = folio_file_page(folio, index);
> +	if (PageHWPoison(page)) {
> +		folio_unlock(folio);
> +		folio_put(folio);
> +		return -EIO;
> +	}
> +
> +	/* Write data, or zeroout the portion of the page */
> +	if (data)
> +		memcpy(page_address(page) + offset, data, len);
> +	else
> +		memset(page_address(page) + offset, 0, len);
> +
> +	SetPageUptodate(page);

This is suspicious.  There is no per-page Uptodate bit, there is only a
per-folio Uptodate bit.  So this should be folio_mark_uptodate().
Except that you've only done one of the pages in the folio, so you
have no business setting the uptodate bit at all.




[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