summaryrefslogtreecommitdiffstats
path: root/fs/cifs/fs_context.c
Commit message (Collapse)AuthorAgeFilesLines
* cifs: In the new mount api we get the full devname as source=Ronnie Sahlberg2021-02-111-1/+15
| | | | | | | | | | | | | | | | so we no longer need to handle or parse the UNC= and prefixpath= options that mount.cifs are generating. This also fixes a bug in the mount command option where the devname would be truncated into just //server/share because we were looking at the truncated UNC value and not the full path. I.e. in the mount command output the devive //server/share/path would show up as just //server/share Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Reviewed-by: Shyam Prasad N <nspmangalore@gmail.com> Signed-off-by: Steve French <stfrench@microsoft.com>
* cifs: do not disable noperm if multiuser mount option is not providedRonnie Sahlberg2021-02-091-2/+2
| | | | | | | | | Fixes small regression in implementation of new mount API. Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Reported-by: Hyunchul Lee <hyc.lee@gmail.com> Tested-by: Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by: Steve French <stfrench@microsoft.com>
* cifs: fix dfs domain referralsRonnie Sahlberg2021-01-281-0/+31
| | | | | | | | | | | The new mount API requires additional changes to how DFS is handled. Additional testing of DFS uncovered problems with domain based DFS referrals (a follow on patch addresses DFS links) which this patch addresses. Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz> Signed-off-by: Steve French <stfrench@microsoft.com>
* cifs: returning mount parm processing errors correctlySteve French2021-01-281-4/+4
| | | | | | | | | | | | | | | | During additional testing of the updated cifs.ko with the new mount API support, we found a few additional cases where we were logging errors, but not returning them to the user. For example: a) invalid security mechanisms b) invalid cache options c) unsupported rdma d) invalid smb dialect requested Fixes: 24e0a1eff9e2 ("cifs: switch to new mount api") Acked-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
* cifs: fix mounts to subdirectories of targetSteve French2021-01-281-0/+1
| | | | | | | | | | | | | The "prefixpath" mount option needs to be ignored which was missed in the recent conversion to the new mount API (prefixpath would be set by the mount helper if mounting a subdirectory of the root of a share e.g. //server/share/subdir) Fixes: 24e0a1eff9e2 ("cifs: switch to new mount api") Suggested-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
* cifs: ignore auto and noauto options if givenAdam Harvey2021-01-281-0/+1
| | | | | | | | | | | | | | | In 24e0a1eff9e2, the noauto and auto options were missed when migrating to the new mount API. As a result, users with noauto in their fstab mount options are now unable to mount cifs filesystems, as they'll receive an "Unknown parameter" error. This restores the old behaviour of ignoring noauto and auto if they're given. Fixes: 24e0a1eff9e2 ("cifs: switch to new mount api") Signed-off-by: Adam Harvey <adam@adamharvey.name> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
* fs: cifs: remove unneeded variable in smb3_fs_context_dupMenglong Dong2021-01-131-3/+1
| | | | | | | | 'rc' in smb3_fs_context_dup is not used and can be removed. Signed-off-by: Menglong Dong <dong.menglong@zte.com.cn> Reviewed-by: Aurelien Aptel <aaptel@suse.com> Signed-off-by: Steve French <stfrench@microsoft.com>
* cifs: Fix support for remount when not changing rsize/wsizeSteve French2020-12-161-0/+7
| | | | | | | | | | | When remounting with the new mount API, we need to set rsize and wsize to the previous values if they are not passed in on the remount. Otherwise they get set to zero which breaks xfstest 452 for example. Signed-off-by: Steve French <stfrench@microsoft.com> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com> Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
* cifs: handle "guest" mount parameterSteve French2020-12-161-0/+4
| | | | | | | | | | With the new mount API it can not handle empty strings for mount parms ("guest" is mapped in userspace mount helper to "user=") so we have to special case it as we do for the password mount parm. Signed-off-by: Steve French <stfrench@microsoft.com> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
* cifs: correct four aliased mount parms to allow use of previous namesSteve French2020-12-161-5/+10
| | | | | | | | | | | | | | | | The updates to the new mount API created aliases for some mount parms e.g. esize, idsfromsid, modefromsid, signloosely as "min_enc_offload", "setuidfromacl", "modesid", "ignore_signature" but did not add back in the original name expected by test cases and current users. It also had incorrect names for a few less used mount parms. Signed-off-by: Steve French <stfrench@microsoft.com> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
* smb3: remind users that witness protocol is experimentalSteve French2020-12-151-0/+1
| | | | | | | | warn_once when using the witness protocol that it is experimental Signed-off-by: Steve French <stfrench@microsoft.com> Reviewed-by: Samuel Cabrero <scabrero@suse.de> Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
* cifs: fix uninitialized variable in smb3_fs_context_parse_paramRonnie Sahlberg2020-12-141-1/+3
| | | | | | | | Addresses an issue noted by the kernel test robot Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
* cifs: update mnt_cifs_flags during reconfigureRonnie Sahlberg2020-12-141-0/+1
| | | | | | | | Many mount flags (e.g. for noperm, noxattr, nobrl, cifsacl, mfsymlinks and more) can be updated now. Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
* cifs: move update of flags into a separate functionRonnie Sahlberg2020-12-141-0/+155
| | | | | | | This function will set/clear flags that can be changed during mount or remount Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
* cifs: do not allow changing posix_paths during remountRonnie Sahlberg2020-12-141-0/+4
| | | | | Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
* cifs: simplify handling of cifs_sb/ctx->local_nlsRonnie Sahlberg2020-12-141-4/+0
| | | | | | | | Only load/unload local_nls from cifs_sb and just make the ctx contain a pointer to cifs_sb->ctx. Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
* cifs: we do not allow changing username/password/unc/... during remountRonnie Sahlberg2020-12-141-3/+50
| | | | | Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
* cifs: add initial reconfigure supportRonnie Sahlberg2020-12-141-3/+33
| | | | | Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
* cifs: move [brw]size from cifs_sb to cifs_sb->ctxRonnie Sahlberg2020-12-141-0/+3
| | | | | Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
* cifs: move cifs_cleanup_volume_info[_content] to fs_context.cRonnie Sahlberg2020-12-141-3/+42
| | | | | | | and rename it to smb3_cleanup_fs_context[_content] Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
* cifs: Add missing sentinel to smb3_fs_parametersDmitry Osipenko2020-12-141-0/+1
| | | | | | | | | | | | | | | | | | | | | Add missing sentinel to smb3_fs_parameters. This fixes ARM32 kernel crashing once CIFS is registered. Unable to handle kernel paging request at virtual address 33626d73 ... (strcmp) from (fs_validate_description) (fs_validate_description) from (register_filesystem) (register_filesystem) from (init_cifs [cifs]) (init_cifs [cifs]) from (do_one_initcall) (do_one_initcall) from (do_init_module) (do_init_module) from (load_module) (load_module) from (sys_finit_module) (sys_finit_module) from (ret_fast_syscal) Fixes: e07724d1cf38 ("cifs: switch to new mount api") Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Reviewed-by: Aurelien Aptel <aaptel@suse.com> Signed-off-by: Steve French <stfrench@microsoft.com>
* cifs: add witness mount option and data structsSamuel Cabrero2020-12-141-0/+8
| | | | | | | | Add 'witness' mount option to register for witness notifications. Signed-off-by: Samuel Cabrero <scabrero@suse.de> Reviewed-by: Aurelien Aptel <aaptel@suse.com> Signed-off-by: Steve French <stfrench@microsoft.com>
* cifs: switch to new mount apiRonnie Sahlberg2020-12-131-72/+991
| | | | | | | See Documentation/filesystems/mount_api.rst for details on new mount API Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
* cifs: move cifs_parse_devname to fs_context.cRonnie Sahlberg2020-12-131-0/+56
| | | | | | | Also rename the function from cifs_ to smb3_ Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
* cifs: rename dup_vol to smb3_fs_context_dup and move it into fs_context.cRonnie Sahlberg2020-12-131-0/+41
| | | | | | | Continue restructuring needed for support of new mount API Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
* cifs: rename smb_vol as smb3_fs_context and move it to fs_context.hRonnie Sahlberg2020-12-131-51/+51
| | | | | | | | Harmonize and change all such variables to 'ctx', where possible. No changes to actual logic. Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
* cifs: move smb version mount options into fs_context.cRonnie Sahlberg2020-10-221-0/+85
| | | | | | | | | | | | | | This and related patches which move mount related code to fs_context.c has the advantage of shriking the code in fs/cifs/connect.c (which had the second most lines of code of any of the files in cifs.ko and was getting harder to read due to its size) and will also make it easier to switch over to the new mount API in the future. Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Reviewed-by: Aurelien Aptel <aaptel@suse.com> Signed-off-by: Steve French <stfrench@microsoft.com>
* cifs: move cache mount options to fs_context.chRonnie Sahlberg2020-10-221-0/+52
| | | | | | | | | | Helps to shrink connect.c and make it more readable by moving mount related code to fs_context.c and fs_context.h Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com> Reviewed-by: Aurelien Aptel <aaptel@suse.com>
* cifs: move security mount options into fs_context.chRonnie Sahlberg2020-10-221-0/+76
| | | | | | | | | This patch moves the parsing of security mount options into fs_context.ch. There are no changes to any logic. Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com> Reviewed-by: Aurelien Aptel <aaptel@suse.com>
* cifs: add files to host new mount apiRonnie Sahlberg2020-10-221-0/+8
This will make it easier in the future, but also will allow us to shrink connect.c which is getting too big, and harder to read Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com> Reviewed-by: Aurelien Aptel <aaptel@suse.com>