diff mbox series

cifs: fix dfs-links

Message ID 20210208064831.19126-1-lsahlber@redhat.com
State New
Headers show
Series cifs: fix dfs-links | expand

Commit Message

Ronnie Sahlberg Feb. 8, 2021, 6:48 a.m. UTC
This fixes a regression following dfs links that was introduced in the
patch series for the new mount api.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
---
 fs/cifs/connect.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Paulo Alcantara Feb. 9, 2021, 4:05 p.m. UTC | #1
Ronnie Sahlberg <lsahlber@redhat.com> writes:

> This fixes a regression following dfs links that was introduced in the
> patch series for the new mount api.
>
> Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
> ---
>  fs/cifs/connect.c | 8 ++++++++
>  1 file changed, 8 insertions(+)

Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>

Thanks Ronnie!
diff mbox series

Patch

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 10fe6d6d2dee..76e4d8d8b3a6 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -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);