Skip to content

Commit

Permalink
Fix mfsymlinks file size check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steve French committed Sep 16, 2014
1 parent 69af38d commit 364d429
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/cifs/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 364d429

Please sign in to comment.