Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234263
b: refs/heads/master
c: 9b44f1b
h: refs/heads/master
i:
  234261: 163e3be
  234259: 3f2d6ae
  234255: 2774bbf
v: v3
  • Loading branch information
Al Viro committed Mar 14, 2011
1 parent 26b7512 commit b49ac7f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 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: 0f9d1a10c341020617e5b1c7f9c16f6a070438ec
refs/heads/master: 9b44f1b3928b6f41532c9a1dc9a6fc665989ad5b
12 changes: 7 additions & 5 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2069,11 +2069,7 @@ static int __open_namei_create(struct nameidata *nd, struct path *path,
mutex_unlock(&dir->d_inode->i_mutex);
dput(nd->path.dentry);
nd->path.dentry = path->dentry;

if (error)
return error;
/* Don't check for write permission, don't truncate */
return may_open(&nd->path, 0, open_flag & ~O_TRUNC);
return error;
}

/*
Expand Down Expand Up @@ -2239,6 +2235,12 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
mnt_drop_write(nd->path.mnt);
goto exit;
}
/* Don't check for write permission, don't truncate */
error = may_open(&nd->path, 0, op->open_flag & ~O_TRUNC);
if (error) {
mnt_drop_write(nd->path.mnt);
goto exit;
}
filp = nameidata_to_filp(nd);
mnt_drop_write(nd->path.mnt);
path_put(&nd->path);
Expand Down

0 comments on commit b49ac7f

Please sign in to comment.