diff options
author | Ronnie Sahlberg <lsahlber@redhat.com> | 2020-11-10 08:59:26 +1000 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2020-12-13 19:12:07 -0600 |
commit | d17abdf7566566fc402c31899b353044a7ff3cf4 (patch) | |
tree | 41a938c3948849b5403c0df8cd9867d67a549243 /fs/cifs/connect.c | |
parent | 4deb075985ec52961cf43666cd9e12af1241b3cf (diff) | |
download | lwn-d17abdf7566566fc402c31899b353044a7ff3cf4.tar.gz lwn-d17abdf7566566fc402c31899b353044a7ff3cf4.zip |
cifs: add an smb3_fs_context to cifs_sb
and populate it during mount in cifs_smb3_do_mount()
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index ec3c952b90f2..5146c4645537 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -2799,6 +2799,9 @@ int cifs_setup_cifs_sb(struct smb3_fs_context *ctx, void cifs_cleanup_volume_info_contents(struct smb3_fs_context *ctx) { + if (ctx == NULL) + return; + /* * Make sure this stays in sync with smb3_fs_context_dup() */ @@ -2818,6 +2821,9 @@ cifs_cleanup_volume_info_contents(struct smb3_fs_context *ctx) ctx->iocharset = NULL; kfree(ctx->prepath); ctx->prepath = NULL; + + unload_nls(ctx->local_nls); + ctx->local_nls = NULL; } void @@ -3739,9 +3745,11 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *ses, static void delayed_free(struct rcu_head *p) { - struct cifs_sb_info *sbi = container_of(p, struct cifs_sb_info, rcu); - unload_nls(sbi->local_nls); - kfree(sbi); + struct cifs_sb_info *cifs_sb = container_of(p, struct cifs_sb_info, rcu); + + unload_nls(cifs_sb->local_nls); + cifs_cleanup_volume_info(cifs_sb->ctx); + kfree(cifs_sb); } void |