aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3/xattr.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2003-08-31 04:36:48 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-08-31 04:36:48 -0700
commit7ff78fd1bdd6adedcacb3a5429eb96cd7e71e7fa (patch)
tree9d5914be571fe4a7f42291afe8a89597ab2b8df9 /fs/ext3/xattr.c
parent2b7220f9d12ed6a06118615f6e0537e374b6159b (diff)
downloadhistory-7ff78fd1bdd6adedcacb3a5429eb96cd7e71e7fa.tar.gz
[PATCH] ext3_setxattr() oops fix
If journal_start() fails it returns an ERR_PTR. Best not pass that into journal_stop().
Diffstat (limited to 'fs/ext3/xattr.c')
-rw-r--r--fs/ext3/xattr.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c
index 402e30ca81fd11..b60885711a3d3e 100644
--- a/fs/ext3/xattr.c
+++ b/fs/ext3/xattr.c
@@ -873,17 +873,22 @@ ext3_xattr_set(struct inode *inode, int name_index, const char *name,
const void *value, size_t value_len, int flags)
{
handle_t *handle;
- int error, error2;
+ int error;
handle = ext3_journal_start(inode, EXT3_DATA_TRANS_BLOCKS);
- if (IS_ERR(handle))
+ if (IS_ERR(handle)) {
error = PTR_ERR(handle);
- else
+ } else {
+ int error2;
+
error = ext3_xattr_set_handle(handle, inode, name_index, name,
value, value_len, flags);
- error2 = ext3_journal_stop(handle);
+ error2 = ext3_journal_stop(handle);
+ if (error == 0)
+ error = error2;
+ }
- return error ? error : error2;
+ return error;
}
/*