afs: Fix the nlink handling of dir-over-dir rename
authorDavid Howells <dhowells@redhat.com>
Thu, 27 May 2021 10:24:33 +0000 (11:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Jun 2021 07:00:39 +0000 (09:00 +0200)
commitee8a8dd10e1e02bc831f03c3f30ee97e0e09c663
tree3c010aa73c7e1e83cbb2eab87bdb8511dac4a306
parentce23a0ad495536148fd7065dbd5b247b423343eb
afs: Fix the nlink handling of dir-over-dir rename

commit f610a5a29c3cfb7d37bdfa4ef52f72ea51f24a76 upstream.

Fix rename of one directory over another such that the nlink on the deleted
directory is cleared to 0 rather than being decremented to 1.

This was causing the generic/035 xfstest to fail.

Fixes: e49c7b2f6de7 ("afs: Build an abstraction around an "operation" concept")
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Link: https://lore.kernel.org/r/162194384460.3999479.7605572278074191079.stgit@warthog.procyon.org.uk/
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/afs/dir.c