Re: [PATCH] cifs: call pagecache_isize_extended() in cifs_setsize() when extending

Namjae Jeon <[email protected]>
Newsgroups org.kernel.vger.linux-cifs,org.kernel.vger.stable
Message-ID <CAKYAXd9HApK3UYwfiak-CbLELePWspyrEpuVFhOAfzo92yz1iQ@mail.gmail.com>
On Fri, Aug 21, 2026 at 6:13 AM Frank Sorenson <[email protected]> wrote:
>
> cifs_setsize() calls truncate_pagecache() but skips
> pagecache_isize_extended() on extension.  truncate_setsize() shows
> the correct pattern:
>
>   i_size_write(inode, newsize);
>   if (newsize > oldsize)
>       pagecache_isize_extended(inode, oldsize, newsize);
>   truncate_pagecache(inode, newsize);
>
> pagecache_isize_extended() zeroes the tail of the page straddling old
> EOF.  Without it, dirty bytes in that region can be written back to
> the server, exposing stale data in the newly extended range.
>
> Cc: [email protected]
> Cc: David Howells <[email protected]>
> Signed-off-by: Frank Sorenson <[email protected]>
Acked-by: Namjae Jeon <[email protected]>
Thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.