linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* setting attributes ignores errors setting the mode
@ 2019-07-31  4:33 Steve French
  0 siblings, 0 replies; only message in thread
From: Steve French @ 2019-07-31  4:33 UTC (permalink / raw)
  To: CIFS

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-07-31  4:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-31  4:33 setting attributes ignores errors setting the mode Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).