Commit 7ff78fd1 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ext3_setxattr() oops fix

If journal_start() fails it returns an ERR_PTR.  Best not pass that into
journal_stop().
parent 2b7220f9
...@@ -873,17 +873,22 @@ ext3_xattr_set(struct inode *inode, int name_index, const char *name, ...@@ -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) const void *value, size_t value_len, int flags)
{ {
handle_t *handle; handle_t *handle;
int error, error2; int error;
handle = ext3_journal_start(inode, EXT3_DATA_TRANS_BLOCKS); handle = ext3_journal_start(inode, EXT3_DATA_TRANS_BLOCKS);
if (IS_ERR(handle)) if (IS_ERR(handle)) {
error = PTR_ERR(handle); error = PTR_ERR(handle);
else } else {
int error2;
error = ext3_xattr_set_handle(handle, inode, name_index, name, error = ext3_xattr_set_handle(handle, inode, name_index, name,
value, value_len, flags); 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;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment