Commit f610a5a2 authored by David Howells's avatar David Howells Committed by Linus Torvalds
Browse files

afs: Fix the nlink handling of dir-over-dir rename

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: e49c7b2f

 ("afs: Build an abstraction around an "operation" concept")
Signed-off-by: default avatarDavid Howells <>
Reviewed-by: default avatarMarc Dionne <>

 # v1
Signed-off-by: default avatarLinus Torvalds <>
parent d7c5303f
......@@ -1919,7 +1919,9 @@ static void afs_rename_edit_dir(struct afs_operation *op)
new_inode = d_inode(new_dentry);
if (new_inode) {
if (new_inode->i_nlink > 0)
if (S_ISDIR(new_inode->i_mode))
else if (new_inode->i_nlink > 0)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment