]> git.baikalelectronics.ru Git - kernel.git/commit
afs: Only update d_fsdata if different in afs_d_revalidate()
authorDavid Howells <dhowells@redhat.com>
Tue, 30 Jul 2019 13:38:51 +0000 (14:38 +0100)
committerDavid Howells <dhowells@redhat.com>
Tue, 30 Jul 2019 13:38:51 +0000 (14:38 +0100)
commitfad892cb92fc0c177b7d73b133a684db369ec28e
tree0290def0100fe4508089c98d0c3f9aea2118dfe0
parentfabec7459416ce765c185f9cba69f7d36efe7ed8
afs: Only update d_fsdata if different in afs_d_revalidate()

In the in-kernel afs filesystem, d_fsdata is set with the data version of
the parent directory.  afs_d_revalidate() will update this to the current
directory version, but it shouldn't do this if it the value it read from
d_fsdata is the same as no lock is held and cmpxchg() is not used.

Fix the code to only change the value if it is different from the current
directory version.

Fixes: 15d9da9ce3a8 ("[AFS]: Add "directory write" support.")
Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/dir.c