]> www.infradead.org Git - linux.git/commitdiff
cifs: Fix zero_point init on inode initialisation
authorDavid Howells <dhowells@redhat.com>
Tue, 3 Sep 2024 14:11:18 +0000 (15:11 +0100)
committerSteve French <stfrench@microsoft.com>
Tue, 3 Sep 2024 15:16:05 +0000 (10:16 -0500)
Fix cifs_fattr_to_inode() such that the ->zero_point tracking variable
is initialised when the inode is initialised.

Fixes: 3ee1a1fc3981 ("cifs: Cut over to using netfslib")
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
cc: Jeff Layton <jlayton@kernel.org>
cc: linux-cifs@vger.kernel.org
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
cc: linux-mm@kvack.org
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/inode.c

index dd0afa23734c8d7d1aa14a0a6fee7ba2cf9c10c5..73e2e6c230b735b9f97a1991626b7a38d22c5453 100644 (file)
@@ -172,6 +172,8 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr,
                CIFS_I(inode)->time = 0; /* force reval */
                return -ESTALE;
        }
+       if (inode->i_state & I_NEW)
+               CIFS_I(inode)->netfs.zero_point = fattr->cf_eof;
 
        cifs_revalidate_cache(inode, fattr);