Skip to contentSkip to conversation

cifs: fix enum usage

PATCH In review [email protected] 2 participants 2 messages Mar 28, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifs: fix enum usage

From: Tom Rix <[email protected]>

Clang build fails with
cifsfs.c:709:18: error: implicit conversion from enumeration
type 'enum statusEnum' to different enumeration type 'enum tid_status_enum'

  tcon->status = CifsExiting;
               ~ ^~~~~~~~~~~

The type of the element status changed, so enum needed to change. Replace CifsExiting with TID_EXITING.

Fixes 7e5c8c02911b ("smb3: cleanup and clarify status of tree connections")
---
 fs/cifs/cifsfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/cifsfs.c +1 -1
index 0789bf1496c74..a47fa44b6d52b 100644
@@ -706,7 +706,7 @@ static void cifs_umount_begin(struct super_block *sb)
 		spin_unlock(&cifs_tcp_ses_lock);
 		return;
 	} else if (tcon->tc_count == 1)
-		tcon->status = CifsExiting;
+		tcon->status = TID_EXITING;
 	spin_unlock(&cifs_tcp_ses_lock);
 
 	/* cancel_brl_requests(tcon); */ /* BB mark all brl mids as exiting */
Signature · 1 line
2.26.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · On Mon, Mar 28, 2022 at 06:03:00AM -0700, [email protected] wrote:

From: Tom Rix <[email protected]>

Clang build fails with
cifsfs.c:709:18: error: implicit conversion from enumeration
type 'enum statusEnum' to different enumeration type 'enum tid_status_enum'

  tcon->status = CifsExiting;
               ~ ^~~~~~~~~~~

The type of the element status changed, so enum needed to change. Replace CifsExiting with TID_EXITING.

Right, this was clearly missed by the below commit, as every other instance of tidStatus was changed to status plus the value from enum tid_status_enum, except this one.

Quoted 2 lines
Fixes 7e5c8c02911b ("smb3: cleanup and clarify status of tree connections")

Thanks for sending the patch!

Quoted 21 lines
---
 fs/cifs/cifsfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/cifsfs.c +1 -1
index 0789bf1496c74..a47fa44b6d52b 100644
@@ -706,7 +706,7 @@ static void cifs_umount_begin(struct super_block *sb)
 		spin_unlock(&cifs_tcp_ses_lock);
 		return;
 	} else if (tcon->tc_count == 1)
-		tcon->status = CifsExiting;
+		tcon->status = TID_EXITING;
 	spin_unlock(&cifs_tcp_ses_lock);
 
 	/* cancel_brl_requests(tcon); */ /* BB mark all brl mids as exiting */
Signature · 1 line
2.26.3