CVE-2026-99137: cifs: don't update i_size in cifs_do_truncate without a cached handle
In the Linux kernel, the following vulnerability has been resolved:
cifs: don't update isize in cifsdotruncate without a cached handle
If findwritablefile() returns null, cifsfileflush will return 0 without issuing setfilesize, and the outer 'if (!rc)' block will set isize to 0 before telling the server to truncate. If the cifsopen() then fails, the inode will have size 0, while the server file is unchanged.
Move the netfsresizefile() and cifssetsize() into the 'if (cfile)', so they only run after a successful setfilesize.
In the no-handle else branch, evict stale pages with truncateinodepages before the OTRUNC open to dispose of old cache pages, and let the open response set the isize.