inode.c (47291baa8ddfdae10663624ff0a15ab165952708) inode.c (2f221d6f7b881d95de1f356a3097d755ab1e47d4)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * fs/kernfs/inode.c - kernfs inode implementation
4 *
5 * Copyright (c) 2001-3 Patrick Mochel
6 * Copyright (c) 2007 SUSE Linux Products GmbH
7 * Copyright (c) 2007, 2013 Tejun Heo <tj@kernel.org>
8 */

--- 108 unchanged lines hidden (view full) ---

117 struct inode *inode = d_inode(dentry);
118 struct kernfs_node *kn = inode->i_private;
119 int error;
120
121 if (!kn)
122 return -EINVAL;
123
124 mutex_lock(&kernfs_mutex);
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * fs/kernfs/inode.c - kernfs inode implementation
4 *
5 * Copyright (c) 2001-3 Patrick Mochel
6 * Copyright (c) 2007 SUSE Linux Products GmbH
7 * Copyright (c) 2007, 2013 Tejun Heo <tj@kernel.org>
8 */

--- 108 unchanged lines hidden (view full) ---

117 struct inode *inode = d_inode(dentry);
118 struct kernfs_node *kn = inode->i_private;
119 int error;
120
121 if (!kn)
122 return -EINVAL;
123
124 mutex_lock(&kernfs_mutex);
125 error = setattr_prepare(dentry, iattr);
125 error = setattr_prepare(&init_user_ns, dentry, iattr);
126 if (error)
127 goto out;
128
129 error = __kernfs_setattr(kn, iattr);
130 if (error)
131 goto out;
132
133 /* this ignores size changes */
126 if (error)
127 goto out;
128
129 error = __kernfs_setattr(kn, iattr);
130 if (error)
131 goto out;
132
133 /* this ignores size changes */
134 setattr_copy(inode, iattr);
134 setattr_copy(&init_user_ns, inode, iattr);
135
136out:
137 mutex_unlock(&kernfs_mutex);
138 return error;
139}
140
141ssize_t kernfs_iop_listxattr(struct dentry *dentry, char *buf, size_t size)
142{

--- 293 unchanged lines hidden ---
135
136out:
137 mutex_unlock(&kernfs_mutex);
138 return error;
139}
140
141ssize_t kernfs_iop_listxattr(struct dentry *dentry, char *buf, size_t size)
142{

--- 293 unchanged lines hidden ---