Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347851
b: refs/heads/master
c: 48f7530
h: refs/heads/master
i:
  347849: 8308d78
  347847: 6eba118
v: v3
  • Loading branch information
Jeff Layton authored and Al Viro committed Dec 20, 2012
1 parent ffe9315 commit bf4d7ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 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: c6a9428401c00a27d3c17264934d14e284570c97
refs/heads/master: 48f7530d3f722617aa7cfea62b09b0c1a8d0173e
8 changes: 7 additions & 1 deletion trunk/fs/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,23 @@ EXPORT_SYMBOL_GPL(vfs_truncate);

static long do_sys_truncate(const char __user *pathname, loff_t length)
{
unsigned int lookup_flags = LOOKUP_FOLLOW;
struct path path;
int error;

if (length < 0) /* sorry, but loff_t says... */
return -EINVAL;

error = user_path(pathname, &path);
retry:
error = user_path_at(AT_FDCWD, pathname, lookup_flags, &path);
if (!error) {
error = vfs_truncate(&path, length);
path_put(&path);
}
if (retry_estale(error, lookup_flags)) {
lookup_flags |= LOOKUP_REVAL;
goto retry;
}
return error;
}

Expand Down

0 comments on commit bf4d7ad

Please sign in to comment.