]> git.baikalelectronics.ru Git - kernel.git/commit
afs: Fix rename operation status delivery
authorDavid Howells <dhowells@redhat.com>
Wed, 8 Apr 2020 19:56:20 +0000 (20:56 +0100)
committerDavid Howells <dhowells@redhat.com>
Mon, 13 Apr 2020 14:09:01 +0000 (15:09 +0100)
commitdf411b39d6a7415d21f617a67f0198567293cac4
tree26fa47281faa787c90c31f350724c7585008fa7a
parent9c4ca7192a70fa78154db68c6dc0c581bb4c851a
afs: Fix rename operation status delivery

The afs_deliver_fs_rename() and yfs_deliver_fs_rename() functions both only
decode the second file status returned unless the parent directories are
different - unfortunately, this means that the xdr pointer isn't advanced
and the volsync record will be read incorrectly in such an instance.

Fix this by always decoding the second status into the second
status/callback block which wasn't being used if the dirs were the same.

The afs_update_dentry_version() calls that update the directory data
version numbers on the dentries can then unconditionally use the second
status record as this will always reflect the state of the destination dir
(the two records will be identical if the destination dir is the same as
the source dir)

Fixes: 15d9da9ce3a8 ("[AFS]: Add "directory write" support.")
Fixes: 22184ef65c2d ("afs: Implement YFS support in the fs client")
Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/dir.c
fs/afs/fsclient.c
fs/afs/yfsclient.c