From 9d97e2c37e98e893e38b3e64923ca68dc9c21e61 Mon Sep 17 00:00:00 2001 From: Jeffrey Layton Date: Tue, 15 Aug 2023 09:42:21 -0400 Subject: [PATCH] cifs: fix bogus cifs_mount error handling in RHEL8 The patch that originally went in for this bug was bogus and could cause cifs_mount to return 0, even though it hadn't properly filled out the superblock. Ensure that we also return an error in this case. Paulo Alcantara suggested -ENOENT in the upstream discussion. Signed-off-by: Jeffrey Layton --- fs/cifs/connect.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index f882b38d4ed3..0af0c0718153 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -3507,8 +3507,10 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx) rc = -ELOOP; } while (rc == -EREMOTE); - if (rc || !tcon) + if (rc || !tcon) { + rc = rc ? rc : -ENOENT; goto error; + } kfree(ref_path); /* -- 2.41.0