24
24
include/linux/fs.h | 6 +++---
25
25
mm/filemap.c | 2 +-
26
26
mm/tiny-shmem.c | 2 +-
27
14 files changed, 45 insertions(+), 37 deletions(-)
27
14 files changed, 44 insertions(+), 37 deletions(-)
37
37
+ struct iattr *attr)
39
39
struct inode *inode = dentry->d_inode;
40
mode_t mode = inode->i_mode;
41
41
--- a/fs/ecryptfs/inode.c
42
42
+++ b/fs/ecryptfs/inode.c
43
@@ -889,6 +889,7 @@ static int ecryptfs_setattr(struct dentr
43
@@ -862,6 +862,7 @@ static int ecryptfs_setattr(struct dentr
46
46
struct dentry *lower_dentry;
48
48
struct inode *inode;
49
49
struct inode *lower_inode;
50
50
struct ecryptfs_crypt_stat *crypt_stat;
51
@@ -899,6 +900,7 @@ static int ecryptfs_setattr(struct dentr
51
@@ -872,6 +873,7 @@ static int ecryptfs_setattr(struct dentr
52
52
inode = dentry->d_inode;
53
53
lower_inode = ecryptfs_inode_to_lower(inode);
54
54
lower_dentry = ecryptfs_dentry_to_lower(dentry);
56
56
mutex_lock(&crypt_stat->cs_mutex);
57
57
if (S_ISDIR(dentry->d_inode->i_mode))
58
58
crypt_stat->flags &= ~(ECRYPTFS_ENCRYPTED);
59
@@ -955,7 +957,7 @@ static int ecryptfs_setattr(struct dentr
59
@@ -922,7 +924,7 @@ static int ecryptfs_setattr(struct dentr
60
if (ia->ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID))
61
ia->ia_valid &= ~ATTR_MODE;
63
63
- rc = notify_change(lower_dentry, ia);
64
64
+ rc = notify_change(lower_dentry, lower_mnt, ia);
70
@@ -1796,7 +1796,8 @@ int do_coredump(long signr, int exit_cod
70
@@ -1784,7 +1784,8 @@ int do_coredump(long signr, int exit_cod
72
72
if (!file->f_op->write)
76
76
+ do_truncate(file->f_path.dentry, file->f_path.mnt, 0, 0, file) != 0)
79
retval = binfmt->core_dump(signr, regs, file);
79
retval = binfmt->core_dump(signr, regs, file, core_limit);
80
80
--- a/fs/fat/file.c
81
81
+++ b/fs/fat/file.c
82
82
@@ -92,7 +92,7 @@ int fat_generic_ioctl(struct inode *inod
104
@@ -1631,7 +1631,8 @@ int may_open(struct nameidata *nd, int a
104
@@ -1660,7 +1660,7 @@ int may_open(struct nameidata *nd, int a
106
106
DQUOT_INIT(inode);
108
- error = do_truncate(dentry, 0, ATTR_MTIME|ATTR_CTIME, NULL);
108
- error = do_truncate(dentry, 0,
109
109
+ error = do_truncate(dentry, nd->mnt, 0,
110
+ ATTR_MTIME|ATTR_CTIME, NULL);
110
ATTR_MTIME|ATTR_CTIME|ATTR_OPEN,
112
put_write_access(inode);
114
113
--- a/fs/nfsd/vfs.c
115
114
+++ b/fs/nfsd/vfs.c
116
@@ -375,7 +375,7 @@ nfsd_setattr(struct svc_rqst *rqstp, str
115
@@ -388,7 +388,7 @@ nfsd_setattr(struct svc_rqst *rqstp, str
117
116
err = nfserr_notsync;
118
117
if (!check_guard || guardtime == inode->i_ctime.tv_sec) {
122
121
err = nfserrno(host_err);
125
@@ -918,13 +918,13 @@ out:
124
@@ -943,13 +943,13 @@ out:
130
129
+static void kill_suid(struct dentry *dentry, struct vfsmount *mnt)
133
ia.ia_valid = ATTR_KILL_SUID | ATTR_KILL_SGID;
132
ia.ia_valid = ATTR_KILL_SUID | ATTR_KILL_SGID | ATTR_KILL_PRIV;
135
134
mutex_lock(&dentry->d_inode->i_mutex);
136
135
- notify_change(dentry, &ia);
138
137
mutex_unlock(&dentry->d_inode->i_mutex);
141
@@ -983,7 +983,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, s
140
@@ -1008,7 +1008,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, s
143
142
/* clear setuid/setgid flag after write */
144
143
if (host_err >= 0 && (inode->i_mode & (S_ISUID | S_ISGID)))
169
168
mutex_unlock(&dentry->d_inode->i_mutex);
172
@@ -270,7 +270,7 @@ static long do_sys_truncate(const char _
171
@@ -271,7 +271,7 @@ static long do_sys_truncate(const char _
173
172
error = locks_verify_truncate(inode, NULL, length);
175
174
DQUOT_INIT(inode);
176
175
- error = do_truncate(nd.dentry, length, 0, NULL);
177
176
+ error = do_truncate(nd.dentry, nd.mnt, length, 0, NULL);
179
put_write_access(inode);
181
@@ -322,7 +322,8 @@ static long do_sys_ftruncate(unsigned in
180
@@ -324,7 +324,8 @@ static long do_sys_ftruncate(unsigned in
183
182
error = locks_verify_truncate(inode, file, length);
191
@@ -580,7 +581,7 @@ asmlinkage long sys_fchmod(unsigned int
190
@@ -582,7 +583,7 @@ asmlinkage long sys_fchmod(unsigned int
192
191
mode = inode->i_mode;
193
192
newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
194
193
newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
197
196
mutex_unlock(&inode->i_mutex);
200
@@ -615,7 +616,7 @@ asmlinkage long sys_fchmodat(int dfd, co
199
@@ -617,7 +618,7 @@ asmlinkage long sys_fchmodat(int dfd, co
201
200
mode = inode->i_mode;
202
201
newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
203
202
newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
206
205
mutex_unlock(&inode->i_mutex);
209
@@ -629,7 +630,8 @@ asmlinkage long sys_chmod(const char __u
208
@@ -631,7 +632,8 @@ asmlinkage long sys_chmod(const char __u
210
209
return sys_fchmodat(AT_FDCWD, filename, mode);
217
216
struct inode * inode;
219
@@ -658,7 +660,7 @@ static int chown_common(struct dentry *
220
if (!S_ISDIR(inode->i_mode))
221
newattrs.ia_valid |= ATTR_KILL_SUID|ATTR_KILL_SGID;
218
@@ -661,7 +663,7 @@ static int chown_common(struct dentry *
220
ATTR_KILL_SUID | ATTR_KILL_SGID | ATTR_KILL_PRIV;
222
221
mutex_lock(&inode->i_mutex);
223
222
- error = notify_change(dentry, &newattrs);
224
223
+ error = notify_change(dentry, mnt, &newattrs);
225
224
mutex_unlock(&inode->i_mutex);
228
@@ -672,7 +674,7 @@ asmlinkage long sys_chown(const char __u
227
@@ -675,7 +677,7 @@ asmlinkage long sys_chown(const char __u
229
228
error = user_path_walk(filename, &nd);
234
233
path_release(&nd);
237
@@ -692,7 +694,7 @@ asmlinkage long sys_fchownat(int dfd, co
236
@@ -695,7 +697,7 @@ asmlinkage long sys_fchownat(int dfd, co
238
237
error = __user_walk_fd(dfd, filename, follow, &nd);
243
242
path_release(&nd);
246
@@ -706,7 +708,7 @@ asmlinkage long sys_lchown(const char __
245
@@ -709,7 +711,7 @@ asmlinkage long sys_lchown(const char __
247
246
error = user_path_walk_link(filename, &nd);
252
251
path_release(&nd);
255
@@ -725,7 +727,7 @@ asmlinkage long sys_fchown(unsigned int
254
@@ -728,7 +730,7 @@ asmlinkage long sys_fchown(unsigned int
257
256
dentry = file->f_path.dentry;
258
audit_inode(NULL, dentry->d_inode);
257
audit_inode(NULL, dentry);
259
258
- error = chown_common(dentry, user, group);
260
259
+ error = chown_common(dentry, file->f_path.mnt, user, group);
264
263
--- a/fs/reiserfs/xattr.c
265
264
+++ b/fs/reiserfs/xattr.c
266
@@ -479,7 +479,7 @@ reiserfs_xattr_set(struct inode *inode,
265
@@ -485,7 +485,7 @@ reiserfs_xattr_set(struct inode *inode,
267
266
newattrs.ia_size = buffer_size;
268
267
newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
269
mutex_lock(&xinode->i_mutex);
268
mutex_lock_nested(&xinode->i_mutex, I_MUTEX_XATTR);
270
269
- err = notify_change(fp->f_path.dentry, &newattrs);
271
270
+ err = notify_change(fp->f_path.dentry, NULL, &newattrs);
275
@@ -819,7 +819,7 @@ reiserfs_chown_xattrs_filler(void *buf,
274
@@ -825,7 +825,7 @@ reiserfs_chown_xattrs_filler(void *buf,
278
277
if (!S_ISDIR(xafile->d_inode->i_mode))
279
278
- err = notify_change(xafile, attrs);
280
+ err = notify_change(xafile, NULL, attrs);
279
+ err = notify_change(xafile, NULL, attrs);
284
@@ -871,7 +871,7 @@ int reiserfs_chown_xattrs(struct inode *
283
@@ -877,7 +877,7 @@ int reiserfs_chown_xattrs(struct inode *
293
292
--- a/fs/sysfs/file.c
294
293
+++ b/fs/sysfs/file.c
295
@@ -524,7 +524,7 @@ int sysfs_chmod_file(struct kobject *kob
296
mutex_lock(&inode->i_mutex);
294
@@ -610,7 +610,7 @@ int sysfs_chmod_file(struct kobject *kob
297
296
newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
298
297
newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
299
298
- rc = notify_change(victim, &newattrs);
300
299
+ rc = notify_change(victim, NULL, &newattrs);
301
mutex_unlock(&inode->i_mutex);
302
mutex_lock(&sysfs_mutex);
304
303
--- a/fs/utimes.c
305
304
+++ b/fs/utimes.c
306
@@ -46,7 +46,7 @@ long do_utimes(int dfd, char __user *fil
305
@@ -54,7 +54,7 @@ long do_utimes(int dfd, char __user *fil
309
308
struct nameidata nd;
312
311
struct inode *inode;
313
312
struct iattr newattrs;
314
313
struct file *f = NULL;
315
@@ -64,16 +64,17 @@ long do_utimes(int dfd, char __user *fil
314
@@ -77,16 +77,17 @@ long do_utimes(int dfd, char __user *fil
335
334
if (IS_RDONLY(inode))
336
@@ -118,7 +119,7 @@ long do_utimes(int dfd, char __user *fil
335
@@ -131,7 +132,7 @@ long do_utimes(int dfd, char __user *fil
339
338
mutex_lock(&inode->i_mutex);
352
351
- struct file *filp);
353
352
+extern int do_truncate(struct dentry *, struct vfsmount *, loff_t start,
354
353
+ unsigned int time_attrs, struct file *filp);
355
extern long do_sys_open(int fdf, const char __user *filename, int flags,
354
extern long do_sys_open(int dfd, const char __user *filename, int flags,
357
356
extern struct file *filp_open(const char *, int, int);
358
@@ -1561,7 +1561,7 @@ extern int do_remount_sb(struct super_bl
357
@@ -1693,7 +1693,7 @@ extern int do_remount_sb(struct super_bl
359
358
#ifdef CONFIG_BLOCK
360
359
extern sector_t bmap(struct inode *, sector_t);
366
365
int (*check_acl)(struct inode *, int));
367
366
--- a/mm/filemap.c
368
367
+++ b/mm/filemap.c
369
@@ -1696,7 +1696,7 @@ int __remove_suid(struct path *path, int
368
@@ -1615,7 +1615,7 @@ int __remove_suid(struct path *path, int
370
369
struct iattr newattrs;
372
371
newattrs.ia_valid = ATTR_FORCE | kill;
377
376
int remove_suid(struct path *path)
378
377
--- a/mm/tiny-shmem.c
379
378
+++ b/mm/tiny-shmem.c
380
@@ -86,7 +86,7 @@ struct file *shmem_file_setup(char *name
381
file->f_mode = FMODE_WRITE | FMODE_READ;
379
@@ -81,7 +81,7 @@ struct file *shmem_file_setup(char *name
380
inode->i_nlink = 0; /* It is unlinked */
383
382
/* notify everyone as to the change of file size */
384
383
- error = do_truncate(dentry, size, 0, file);