From 63a803540a1d67797d8b2dce59331b81dcf29e78 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Sat, 7 Jul 2018 18:24:38 +0200 Subject: [PATCH] containerfs: rename doesn't rm src if dest is the same file Signed-off-by: Giuseppe Scrivano --- main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.c b/main.c index 4af6b87..e0ee17b 100644 --- a/main.c +++ b/main.c @@ -2319,6 +2319,12 @@ lo_rename (fuse_req_t req, fuse_ino_t parent, const char *name, rm = hash_lookup (destpnode->children, &key); if (rm) { + if (rm->ino == node->ino) + { + fuse_reply_err (req, 0); + return; + } + hash_delete (destpnode->children, rm); if (rm->lookups > 0) node_free (rm);