Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e55f1d1d authored by Al Viro's avatar Al Viro
Browse files

Merge remote-tracking branch 'jk/vfs' into work.misc

parents f334bcd9 030b533c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -287,8 +287,8 @@ implementing on-disk size changes. Start with a copy of the old inode_setattr
and vmtruncate, and the reorder the vmtruncate + foofs_vmtruncate sequence to
be in order of zeroing blocks using block_truncate_page or similar helpers,
size update and on finally on-disk truncation which should not fail.
inode_change_ok now includes the size checks for ATTR_SIZE and must be called
in the beginning of ->setattr unconditionally.
setattr_prepare (which used to be inode_change_ok) now includes the size checks
for ATTR_SIZE and must be called in the beginning of ->setattr unconditionally.

[mandatory]

+1 −1
Original line number Diff line number Diff line
@@ -1192,7 +1192,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import)
		attr->ia_valid |= ATTR_MTIME | ATTR_CTIME;
	}

	/* POSIX: check before ATTR_*TIME_SET set (from inode_change_ok) */
	/* POSIX: check before ATTR_*TIME_SET set (from setattr_prepare) */
	if (attr->ia_valid & TIMES_SET_FLAGS) {
		if ((!uid_eq(current_fsuid(), inode->i_uid)) &&
		    !capable(CFS_CAP_FOWNER))
+17 −23
Original line number Diff line number Diff line
@@ -276,25 +276,20 @@ static int v9fs_xattr_set_acl(const struct xattr_handler *handler,
	switch (handler->flags) {
	case ACL_TYPE_ACCESS:
		if (acl) {
			umode_t mode = inode->i_mode;
			retval = posix_acl_equiv_mode(acl, &mode);
			if (retval < 0)
				goto err_out;
			else {
			struct iattr iattr;
				if (retval == 0) {

			retval = posix_acl_update_mode(inode, &iattr.ia_mode, &acl);
			if (retval)
				goto err_out;
			if (!acl) {
				/*
				 * ACL can be represented
				 * by the mode bits. So don't
				 * update ACL.
				 */
					acl = NULL;
				value = NULL;
				size = 0;
			}
				/* Updte the mode bits */
				iattr.ia_mode = ((mode & S_IALLUGO) |
						 (inode->i_mode & ~S_IALLUGO));
			iattr.ia_valid = ATTR_MODE;
			/* FIXME should we update ctime ?
			 * What is the following setxattr update the
@@ -302,7 +297,6 @@ static int v9fs_xattr_set_acl(const struct xattr_handler *handler,
			 */
			v9fs_vfs_setattr_dotl(dentry, &iattr);
		}
		}
		break;
	case ACL_TYPE_DEFAULT:
		if (!S_ISDIR(inode->i_mode)) {
+1 −1
Original line number Diff line number Diff line
@@ -1094,7 +1094,7 @@ static int v9fs_vfs_setattr(struct dentry *dentry, struct iattr *iattr)
	struct p9_wstat wstat;

	p9_debug(P9_DEBUG_VFS, "\n");
	retval = inode_change_ok(d_inode(dentry), iattr);
	retval = setattr_prepare(dentry, iattr);
	if (retval)
		return retval;

+1 −1
Original line number Diff line number Diff line
@@ -558,7 +558,7 @@ int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr)

	p9_debug(P9_DEBUG_VFS, "\n");

	retval = inode_change_ok(inode, iattr);
	retval = setattr_prepare(dentry, iattr);
	if (retval)
		return retval;

Loading