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

Commit 31051c85 authored by Jan Kara's avatar Jan Kara
Browse files

fs: Give dentry to inode_change_ok() instead of inode



inode_change_ok() will be resposible for clearing capabilities and IMA
extended attributes and as such will need dentry. Give it as an argument
to inode_change_ok() instead of an inode. Also rename inode_change_ok()
to setattr_prepare() to better relect that it does also some
modifications in addition to checks.

Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 62490330
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))
+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;

+1 −1
Original line number Diff line number Diff line
@@ -303,7 +303,7 @@ adfs_notify_change(struct dentry *dentry, struct iattr *attr)
	unsigned int ia_valid = attr->ia_valid;
	int error;
	
	error = inode_change_ok(inode, attr);
	error = setattr_prepare(dentry, attr);

	/*
	 * we can't change the UID or GID of any file -
Loading