[PATCH] [SMB3] Fix oops when creating symlinks on smb3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When the protocol ops for create mf symlink was added
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 on smb2/smb3 mounts rather than cifs
mount

I will add a followon patch for mfsymlinks for SMB3 but in the
meantime need to avoid this possible oops.

Signed-off-by: Steve French <smfrench@xxxxxxxxx>
Cc: <stable@xxxxxxxxxxxxxxx> # 3.14+
CC: Sachin Prabhu <sprabhu@xxxxxxxxxx>
---
 fs/cifs/link.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index 68559fd..a5c2812 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -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;


-- 
Thanks,

Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux