Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157334
b: refs/heads/master
c: 939a942
h: refs/heads/master
v: v3
  • Loading branch information
Amerigo Wang authored and James Morris committed Aug 21, 2009
1 parent 9a97d55 commit 7c23403
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bc6a6008e5e3c7a30191a7f19ab19e85b14b1705
refs/heads/master: 939a9421eb53d3ea83188ae13802779041caefdb
10 changes: 6 additions & 4 deletions trunk/fs/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ SYSCALL_DEFINE3(fstatfs64, unsigned int, fd, size_t, sz, struct statfs64 __user
int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
struct file *filp)
{
int err;
int ret;
struct iattr newattrs;

/* Not pretty: "inode->i_size" shouldn't really be signed. But it is. */
Expand All @@ -214,12 +214,14 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
}

/* Remove suid/sgid on truncate too */
newattrs.ia_valid |= should_remove_suid(dentry);
ret = should_remove_suid(dentry);
if (ret)
newattrs.ia_valid |= ret | ATTR_FORCE;

mutex_lock(&dentry->d_inode->i_mutex);
err = notify_change(dentry, &newattrs);
ret = notify_change(dentry, &newattrs);
mutex_unlock(&dentry->d_inode->i_mutex);
return err;
return ret;
}

static long do_sys_truncate(const char __user *pathname, loff_t length)
Expand Down

0 comments on commit 7c23403

Please sign in to comment.