Skip to contentSkip to conversation

cifs: fix dfs-links

PATCH In review Ronnie Sahlberg 2 participants 2 messages Feb 8, 2021 – Feb 9, 2021

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

PATCH 1/1 cifs: fix dfs-links

This fixes a regression following dfs links that was introduced in the patch series for the new mount api.

---
 fs/cifs/connect.c | 8 ++++++++
 1 file changed, 8 insertions(+)
fs/cifs/connect.c +8 -0
index 10fe6d6d2dee..76e4d8d8b3a6 100644
@@ -2983,6 +2983,14 @@ expand_dfs_referral(const unsigned int xid, struct cifs_ses *ses,
 			rc = PTR_ERR(mdata);
 			mdata = NULL;
 		} else {
+			/*
+			 * We can not clear out the whole structure since we
+			 * no longer have an explicit function to parse
+			 * a mount-string. Instead we need to clear out the
+			 * individual fields that are no longer valid.
+			 */
+			kfree(ctx->prepath);
+			ctx->prepath = NULL;
 			rc = cifs_setup_volume_info(ctx, mdata, fake_devname);
 		}
 		kfree(fake_devname);
Signature · 1 line
2.13.6