Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (114 commits) Btrfs: check for a null fs root when writing to the backup root log Btrfs: fix race during transaction joins Btrfs: fix a potential btrfs_bio leak on scrub fixups Btrfs: rename btrfs_bio multi -> bbio for consistency Btrfs: stop leaking btrfs_bios on readahead Btrfs: stop the readahead threads on failed mount Btrfs: fix extent_buffer leak in the metadata IO error handling Btrfs: fix the new inspection ioctls for 32 bit compat Btrfs: fix delayed insertion reservation Btrfs: ClearPageError during writepage and clean_tree_block Btrfs: be smarter about committing the transaction in reserve_metadata_bytes Btrfs: make a delayed_block_rsv for the delayed item insertion Btrfs: add a log of past tree roots btrfs: separate superblock items out of fs_info Btrfs: use the global reserve when truncating the free space cache inode Btrfs: release metadata from global reserve if we have to fallback for unlink Btrfs: make sure to flush queued bios if write_cache_pages waits Btrfs: fix extent pinning bugs in the tree log Btrfs: make sure btrfs_remove_free_space doesn't leak EAGAIN Btrfs: don't wait as long for more batches during SSD log commit ...
This commit is contained in:
@ -127,6 +127,17 @@ static int do_setxattr(struct btrfs_trans_handle *trans,
|
||||
again:
|
||||
ret = btrfs_insert_xattr_item(trans, root, path, btrfs_ino(inode),
|
||||
name, name_len, value, size);
|
||||
/*
|
||||
* If we're setting an xattr to a new value but the new value is say
|
||||
* exactly BTRFS_MAX_XATTR_SIZE, we could end up with EOVERFLOW getting
|
||||
* back from split_leaf. This is because it thinks we'll be extending
|
||||
* the existing item size, but we're asking for enough space to add the
|
||||
* item itself. So if we get EOVERFLOW just set ret to EEXIST and let
|
||||
* the rest of the function figure it out.
|
||||
*/
|
||||
if (ret == -EOVERFLOW)
|
||||
ret = -EEXIST;
|
||||
|
||||
if (ret == -EEXIST) {
|
||||
if (flags & XATTR_CREATE)
|
||||
goto out;
|
||||
|
Reference in New Issue
Block a user