Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

afs: Fix EEXIST error returned from afs_rmdir() to be ENOTEMPTY

AFS servers pass back a code indicating EEXIST when they're asked to remove
a directory that is not empty rather than ENOTEMPTY because not all the
systems that an AFS server can run on have the latter error available and
AFS preexisted the addition of that error in general.

Fix afs_rmdir() to translate EEXIST to ENOTEMPTY.

Fixes: 260a980317da ("[AFS]: Add "directory write" support.")
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/r/20241216204124.3752367-13-dhowells@redhat.com
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

David Howells and committed by
Christian Brauner
b49194da 6e0b503d

+6 -1
+6 -1
fs/afs/dir.c
··· 1472 1472 op->file[1].vnode = vnode; 1473 1473 } 1474 1474 1475 - return afs_do_sync_operation(op); 1475 + ret = afs_do_sync_operation(op); 1476 + 1477 + /* Not all systems that can host afs servers have ENOTEMPTY. */ 1478 + if (ret == -EEXIST) 1479 + ret = -ENOTEMPTY; 1480 + return ret; 1476 1481 1477 1482 error: 1478 1483 return afs_put_operation(op);