diff options
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/base.c | 7 | ||||
-rw-r--r-- | fs/proc/generic.c | 9 | ||||
-rw-r--r-- | fs/proc/proc_sysctl.c | 7 |
3 files changed, 1 insertions, 22 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 5a5a0be40e40..9b43ff77a51e 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -542,13 +542,6 @@ int proc_setattr(struct dentry *dentry, struct iattr *attr) | |||
542 | if (error) | 542 | if (error) |
543 | return error; | 543 | return error; |
544 | 544 | ||
545 | if ((attr->ia_valid & ATTR_SIZE) && | ||
546 | attr->ia_size != i_size_read(inode)) { | ||
547 | error = vmtruncate(inode, attr->ia_size); | ||
548 | if (error) | ||
549 | return error; | ||
550 | } | ||
551 | |||
552 | setattr_copy(inode, attr); | 545 | setattr_copy(inode, attr); |
553 | mark_inode_dirty(inode); | 546 | mark_inode_dirty(inode); |
554 | return 0; | 547 | return 0; |
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index e659a0ff1da7..e064f562b1f7 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c | |||
@@ -261,16 +261,9 @@ static int proc_notify_change(struct dentry *dentry, struct iattr *iattr) | |||
261 | if (error) | 261 | if (error) |
262 | return error; | 262 | return error; |
263 | 263 | ||
264 | if ((iattr->ia_valid & ATTR_SIZE) && | ||
265 | iattr->ia_size != i_size_read(inode)) { | ||
266 | error = vmtruncate(inode, iattr->ia_size); | ||
267 | if (error) | ||
268 | return error; | ||
269 | } | ||
270 | |||
271 | setattr_copy(inode, iattr); | 264 | setattr_copy(inode, iattr); |
272 | mark_inode_dirty(inode); | 265 | mark_inode_dirty(inode); |
273 | 266 | ||
274 | de->uid = inode->i_uid; | 267 | de->uid = inode->i_uid; |
275 | de->gid = inode->i_gid; | 268 | de->gid = inode->i_gid; |
276 | de->mode = inode->i_mode; | 269 | de->mode = inode->i_mode; |
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 701580ddfcc3..1827d88ad58b 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c | |||
@@ -736,13 +736,6 @@ static int proc_sys_setattr(struct dentry *dentry, struct iattr *attr) | |||
736 | if (error) | 736 | if (error) |
737 | return error; | 737 | return error; |
738 | 738 | ||
739 | if ((attr->ia_valid & ATTR_SIZE) && | ||
740 | attr->ia_size != i_size_read(inode)) { | ||
741 | error = vmtruncate(inode, attr->ia_size); | ||
742 | if (error) | ||
743 | return error; | ||
744 | } | ||
745 | |||
746 | setattr_copy(inode, attr); | 739 | setattr_copy(inode, attr); |
747 | mark_inode_dirty(inode); | 740 | mark_inode_dirty(inode); |
748 | return 0; | 741 | return 0; |