setting attributes ignores errors setting the mode

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

 



If we try to set the mode and (for example) get a sharing violation -
it looks like the return code is ignored for the wrong cases (ie
ignored for errors setting size or mode but not for times), if I am
reading the below correctly (see cifs_setattr_nounix)

        if (attrs->ia_valid & (ATTR_MTIME|ATTR_ATIME|ATTR_CTIME) ||
            ((attrs->ia_valid & ATTR_MODE) && dosattr)) {
                rc = cifs_set_file_info(inode, attrs, xid, full_path, dosattr);
                /* BB: check for rc = -EOPNOTSUPP and switch to legacy mode */

                /* Even if error on time set, no sense failing the call if
                the server would set the time to a reasonable value anyway,
                and this check ensures that we are not being called from
                sys_utimes in which case we ought to fail the call back to
                the user when the server rejects the call */
                if ((rc) && (attrs->ia_valid &
                                (ATTR_MODE | ATTR_GID | ATTR_UID | ATTR_SIZE)))
                        rc = 0;
        }

Isn't this backwards? Or am I misreading it?
-- 
Thanks,

Steve



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

  Powered by Linux