]> git.baikalelectronics.ru Git - kernel.git/commit
NFSv4: Fix fscache cookie aux_data to ensure change_attr is included
authorDave Wysochanski <dwysocha@redhat.com>
Thu, 16 Apr 2020 10:06:08 +0000 (06:06 -0400)
committerDavid Howells <dhowells@redhat.com>
Fri, 8 May 2020 21:20:24 +0000 (22:20 +0100)
commita0c84d09dfd51d1a269c9f3abc56bcf743c681ee
tree738e3362817b9c097f96433e2374cfbdfddd29e6
parent1d8fdc3ee24d2ef8da30b9ae10c6f48ec0f3fc66
NFSv4: Fix fscache cookie aux_data to ensure change_attr is included

Commit c0c07a2c9582 ("fscache: Attach the index key and aux data to
the cookie") added the aux_data and aux_data_len to parameters to
fscache_acquire_cookie(), and updated the callers in the NFS client.
In the process it modified the aux_data to include the change_attr,
but missed adding change_attr to a couple places where aux_data was
used.  Specifically, when opening a file and the change_attr is not
added, the following attempt to lookup an object will fail inside
cachefiles_check_object_xattr() = -116 due to
nfs_fscache_inode_check_aux() failing memcmp on auxdata and returning
FSCACHE_CHECKAUX_OBSOLETE.

Fix this by adding nfs_fscache_update_auxdata() to set the auxdata
from all relevant fields in the inode, including the change_attr.

Fixes: c0c07a2c9582 ("fscache: Attach the index key and aux data to the cookie")
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
fs/nfs/fscache.c