* [patch 09/50] ext3/4: fix uninitialized bs in ext3/4_xattr_set_handle()
[not found] <20080607010215.358296706@sous-sol.org>
@ 2008-06-07 1:02 ` Chris Wright
0 siblings, 0 replies; only message in thread
From: Chris Wright @ 2008-06-07 1:02 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, Tiger Yang,
linux-ext4, Andreas Gruenbacher, Andreas Dilger,
Greg Kroah-Hartman
[-- Attachment #1: ext3-4-fix-uninitialized-bs-in-ext3-4_xattr_set_handle.patch --]
[-- Type: text/plain, Size: 2107 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Tiger Yang <tiger.yang@oracle.com>
commit 7e01c8e5420b6c7f9d85d34c15d8c7a15c9fc720 upstream
This fix the uninitialized bs when we try to replace a xattr entry in
ibody with the new value which require more than free space.
This situation only happens we format ext3/4 with inode size more than 128 and
we have put xattr entries both in ibody and block. The consequences about
this bug is we will lost the xattr block which pointed by i_file_acl with all
xattr entires in it. We will alloc a new xattr block and put that large value
entry in it. The old xattr block will become orphan block.
Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
Cc: <linux-ext4@vger.kernel.org>
Cc: Andreas Gruenbacher <agruen@suse.de>
Acked-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
fs/ext3/xattr.c | 5 +++++
fs/ext4/xattr.c | 5 +++++
2 files changed, 10 insertions(+)
--- a/fs/ext3/xattr.c
+++ b/fs/ext3/xattr.c
@@ -1000,6 +1000,11 @@ ext3_xattr_set_handle(handle_t *handle,
i.value = NULL;
error = ext3_xattr_block_set(handle, inode, &i, &bs);
} else if (error == -ENOSPC) {
+ if (EXT3_I(inode)->i_file_acl && !bs.s.base) {
+ error = ext3_xattr_block_find(inode, &i, &bs);
+ if (error)
+ goto cleanup;
+ }
error = ext3_xattr_block_set(handle, inode, &i, &bs);
if (error)
goto cleanup;
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -1011,6 +1011,11 @@ ext4_xattr_set_handle(handle_t *handle,
i.value = NULL;
error = ext4_xattr_block_set(handle, inode, &i, &bs);
} else if (error == -ENOSPC) {
+ if (EXT4_I(inode)->i_file_acl && !bs.s.base) {
+ error = ext4_xattr_block_find(inode, &i, &bs);
+ if (error)
+ goto cleanup;
+ }
error = ext4_xattr_block_set(handle, inode, &i, &bs);
if (error)
goto cleanup;
--
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-06-07 1:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20080607010215.358296706@sous-sol.org>
2008-06-07 1:02 ` [patch 09/50] ext3/4: fix uninitialized bs in ext3/4_xattr_set_handle() Chris Wright
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).