SMB3: Fix oops when creating symlinks on smb3

commit da80659d4a upstream.

We were not checking for symlink support properly for SMB2/SMB3
mounts so could oops when mounted with mfsymlinks when try
to create symlink when mfsymlinks on smb2/smb3 mounts

Signed-off-by: Steve French <smfrench@gmail.com>
CC: Sachin Prabhu <sprabhu@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Steve French 2014-09-14 23:27:09 -05:00 committed by Greg Kroah-Hartman
parent 8e3006d02b
commit d51afb094e
1 changed files with 6 additions and 2 deletions

View File

@ -213,8 +213,12 @@ create_mf_symlink(const unsigned int xid, struct cifs_tcon *tcon,
if (rc)
goto out;
rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon, cifs_sb,
fromName, buf, &bytes_written);
if (tcon->ses->server->ops->create_mf_symlink)
rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon,
cifs_sb, fromName, buf, &bytes_written);
else
rc = -EOPNOTSUPP;
if (rc)
goto out;