[PATCH 21/35] cifs: Propagate error code from CIFSSMBSetFileInfo() to cifs_rename_pending_delete()

Pali Rohár posted 35 patches 1 month ago
[PATCH 21/35] cifs: Propagate error code from CIFSSMBSetFileInfo() to cifs_rename_pending_delete()
Posted by Pali Rohár 1 month ago
Function CIFSSMBSetFileInfo() setting the file to the delete pending state,
the core part of the cifs_rename_pending_delete() functionality.

So do not mask error code from CIFSSMBSetFileInfo() function and properly
propagate it to the caller of cifs_rename_pending_delete().

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 fs/smb/client/inode.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c
index 63ab233517f2..b0526787138d 100644
--- a/fs/smb/client/inode.c
+++ b/fs/smb/client/inode.c
@@ -1822,10 +1822,8 @@ cifs_rename_pending_delete(const char *full_path, struct dentry *dentry,
 		 */
 		if (rc == -ENOENT)
 			rc = 0;
-		else if (rc != 0) {
-			rc = -EBUSY;
+		else if (rc != 0)
 			goto undo_rename;
-		}
 		set_bit(CIFS_INO_DELETE_PENDING, &cifsInode->flags);
 	}
 
-- 
2.20.1