Discussion:
Fix problem recognizing symlinks
Dan Carpenter
2014-09-26 15:06:15 UTC
Permalink
Hello Steve French,

The patch 2b20ac4fcd7b: "Fix problem recognizing symlinks" from Sep
25, 2014, leads to the following static checker warning:

fs/cifs/smb1ops.c:589 cifs_query_path_info()
warn: we tested 'rc' before and it was 'false'

fs/cifs/smb1ops.c
569
570 if (!rc && (le32_to_cpu(data->Attributes) & ATTR_REPARSE)) {
^^^

571 int tmprc;
572 int oplock = 0;
573 struct cifs_fid fid;
574 struct cifs_open_parms oparms;
575
576 oparms.tcon = tcon;
577 oparms.cifs_sb = cifs_sb;
578 oparms.desired_access = FILE_READ_ATTRIBUTES;
579 oparms.create_options = 0;
580 oparms.disposition = FILE_OPEN;
581 oparms.path = full_path;
582 oparms.fid = &fid;
583 oparms.reconnect = false;
584
585 /* Need to check if this is a symbolic link or not */
586 tmprc = CIFS_open(xid, &oparms, &oplock, NULL);
587 if (tmprc == -EOPNOTSUPP)
588 *symlink = true;
589 else if (rc == 0)
^^^^^^^
The patch adds this new always true condition. It's not clear what the
intent was.

590 CIFSSMBClose(xid, tcon, fid.netfid);
591 }

regards,
dan carpenter
Steve French
2014-09-26 15:14:52 UTC
Permalink
That is already fixed in cifs-2.6.git for-next
Post by Dan Carpenter
Hello Steve French,
The patch 2b20ac4fcd7b: "Fix problem recognizing symlinks" from Sep
fs/cifs/smb1ops.c:589 cifs_query_path_info()
warn: we tested 'rc' before and it was 'false'
fs/cifs/smb1ops.c
569
570 if (!rc && (le32_to_cpu(data->Attributes) & ATTR_REPARSE)) {
^^^
571 int tmprc;
572 int oplock = 0;
573 struct cifs_fid fid;
574 struct cifs_open_parms oparms;
575
576 oparms.tcon = tcon;
577 oparms.cifs_sb = cifs_sb;
578 oparms.desired_access = FILE_READ_ATTRIBUTES;
579 oparms.create_options = 0;
580 oparms.disposition = FILE_OPEN;
581 oparms.path = full_path;
582 oparms.fid = &fid;
583 oparms.reconnect = false;
584
585 /* Need to check if this is a symbolic link or not */
586 tmprc = CIFS_open(xid, &oparms, &oplock, NULL);
587 if (tmprc == -EOPNOTSUPP)
588 *symlink = true;
589 else if (rc == 0)
^^^^^^^
The patch adds this new always true condition. It's not clear what the
intent was.
590 CIFSSMBClose(xid, tcon, fid.netfid);
591 }
regards,
dan carpenter
--
Thanks,

Steve
Loading...