Fix mfsymlinks file size check
authorSteve French <smfrench@gmail.com>
Tue, 16 Sep 2014 11:40:25 +0000 (06:40 -0500)
committerSteve French <smfrench@gmail.com>
Tue, 16 Sep 2014 11:48:20 +0000 (06:48 -0500)
If the mfsymlinks file size has changed (e.g. the file no longer
represents an emulated symlink) we were not returning an error properly.

Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
fs/cifs/link.c

index a5c2812ead6831faf5e97645ab770384fcca096d..5657416d3483fd9dea39601e61e5c64e08ec3894 100644 (file)
@@ -343,9 +343,11 @@ cifs_query_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,
        if (rc)
                return rc;
 
-       if (file_info.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE))
+       if (file_info.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE)) {
+               rc = -ENOENT;
                /* it's not a symlink */
                goto out;
+       }
 
        io_parms.netfid = fid.netfid;
        io_parms.pid = current->tgid;