]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.32.1/0009-ext4-journal-all-modifications-in-ext4_xattr_set_han.patch
drop queue-4.14/mips-make-sure-dt-memory-regions-are-valid.patch
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.1 / 0009-ext4-journal-all-modifications-in-ext4_xattr_set_han.patch
CommitLineData
e46fb18b
GKH
1From 22d31ce67bb060aba86bf20ba6f69cb9e39a1fa2 Mon Sep 17 00:00:00 2001
2From: Eric Sandeen <sandeen@redhat.com>
3Date: Sun, 15 Nov 2009 15:30:52 -0500
4Subject: [PATCH 09/30] ext4: journal all modifications in ext4_xattr_set_handle
5
6(cherry picked from commit 86ebfd08a1930ccedb8eac0aeb1ed4b8b6a41dbc)
7
8ext4_xattr_set_handle() was zeroing out an inode outside
9of journaling constraints; this is one of the accesses that
10was causing the crc errors in journal replay as seen in
11kernel.org bugzilla #14354.
12
13Reviewed-by: Andreas Dilger <adilger@sun.com>
14Signed-off-by: Eric Sandeen <sandeen@redhat.com>
15Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
16Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17---
18 fs/ext4/xattr.c | 7 ++++---
19 1 file changed, 4 insertions(+), 3 deletions(-)
20
21--- a/fs/ext4/xattr.c
22+++ b/fs/ext4/xattr.c
23@@ -988,6 +988,10 @@ ext4_xattr_set_handle(handle_t *handle,
24 if (error)
25 goto cleanup;
26
27+ error = ext4_journal_get_write_access(handle, is.iloc.bh);
28+ if (error)
29+ goto cleanup;
30+
31 if (EXT4_I(inode)->i_state & EXT4_STATE_NEW) {
32 struct ext4_inode *raw_inode = ext4_raw_inode(&is.iloc);
33 memset(raw_inode, 0, EXT4_SB(inode->i_sb)->s_inode_size);
34@@ -1013,9 +1017,6 @@ ext4_xattr_set_handle(handle_t *handle,
35 if (flags & XATTR_CREATE)
36 goto cleanup;
37 }
38- error = ext4_journal_get_write_access(handle, is.iloc.bh);
39- if (error)
40- goto cleanup;
41 if (!value) {
42 if (!is.s.not_found)
43 error = ext4_xattr_ibody_set(handle, inode, &i, &is);