Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309977
b: refs/heads/master
c: 7449af1
h: refs/heads/master
i:
  309975: f435809
v: v3
  • Loading branch information
Al Viro committed May 30, 2012
1 parent 6526897 commit 8c967c8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 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: 863ced7fe762f80e67bc9171e47c7d80032cce12
refs/heads/master: 7449af1e8b795abf4ef829ac507861f34dca30b4
20 changes: 12 additions & 8 deletions trunk/fs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,12 @@ SYSCALL_DEFINE5(lsetxattr, const char __user *, pathname,
SYSCALL_DEFINE5(fsetxattr, int, fd, const char __user *, name,
const void __user *,value, size_t, size, int, flags)
{
int fput_needed;
struct file *f;
struct dentry *dentry;
int error = -EBADF;

f = fget(fd);
f = fget_light(fd, &fput_needed);
if (!f)
return error;
dentry = f->f_path.dentry;
Expand All @@ -413,7 +414,7 @@ SYSCALL_DEFINE5(fsetxattr, int, fd, const char __user *, name,
error = setxattr(dentry, name, value, size, flags);
mnt_drop_write_file(f);
}
fput(f);
fput_light(f, fput_needed);
return error;
}

Expand Down Expand Up @@ -486,15 +487,16 @@ SYSCALL_DEFINE4(lgetxattr, const char __user *, pathname,
SYSCALL_DEFINE4(fgetxattr, int, fd, const char __user *, name,
void __user *, value, size_t, size)
{
int fput_needed;
struct file *f;
ssize_t error = -EBADF;

f = fget(fd);
f = fget_light(fd, &fput_needed);
if (!f)
return error;
audit_inode(NULL, f->f_path.dentry);
error = getxattr(f->f_path.dentry, name, value, size);
fput(f);
fput_light(f, fput_needed);
return error;
}

Expand Down Expand Up @@ -566,15 +568,16 @@ SYSCALL_DEFINE3(llistxattr, const char __user *, pathname, char __user *, list,

SYSCALL_DEFINE3(flistxattr, int, fd, char __user *, list, size_t, size)
{
int fput_needed;
struct file *f;
ssize_t error = -EBADF;

f = fget(fd);
f = fget_light(fd, &fput_needed);
if (!f)
return error;
audit_inode(NULL, f->f_path.dentry);
error = listxattr(f->f_path.dentry, list, size);
fput(f);
fput_light(f, fput_needed);
return error;
}

Expand Down Expand Up @@ -634,11 +637,12 @@ SYSCALL_DEFINE2(lremovexattr, const char __user *, pathname,

SYSCALL_DEFINE2(fremovexattr, int, fd, const char __user *, name)
{
int fput_needed;
struct file *f;
struct dentry *dentry;
int error = -EBADF;

f = fget(fd);
f = fget_light(fd, &fput_needed);
if (!f)
return error;
dentry = f->f_path.dentry;
Expand All @@ -648,7 +652,7 @@ SYSCALL_DEFINE2(fremovexattr, int, fd, const char __user *, name)
error = removexattr(dentry, name);
mnt_drop_write_file(f);
}
fput(f);
fput_light(f, fput_needed);
return error;
}

Expand Down

0 comments on commit 8c967c8

Please sign in to comment.