Linux-CIFS Archive on lore.kernel.org
 help / color / 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, back to index

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

Linux-CIFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-cifs/0 linux-cifs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-cifs linux-cifs/ https://lore.kernel.org/linux-cifs \
		linux-cifs@vger.kernel.org
	public-inbox-index linux-cifs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-cifs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git