diff options
author | Theodore Ts'o <tytso@mit.edu> | 2012-10-10 01:06:58 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-26 12:14:31 -0800 |
commit | 19dfc178ae0ed43e3cc8407f7876497a3ee5ba95 (patch) | |
tree | b9e3c1a3e3a70eabaeb528b3456c30e38f26d773 /fs/ext4/resize.c | |
parent | 03faff7a2288f69b0a2218f1cd0e0d81e31e6509 (diff) |
ext4: fix metadata checksum calculation for the superblock
commit 06db49e68ae70cf16819b85a14057acb2820776a upstream.
The function ext4_handle_dirty_super() was calculating the superblock
on the wrong block data. As a result, when the superblock is modified
while it is mounted (most commonly, when inodes are added or removed
from the orphan list), the superblock checksum would be wrong. We
didn't notice because the superblock *was* being correctly calculated
in ext4_commit_super(), and this would get called when the file system
was unmounted. So the problem only became obvious if the system
crashed while the file system was mounted.
Fix this by removing the poorly designed function signature for
ext4_superblock_csum_set(); if it only took a single argument, the
pointer to a struct superblock, the ambiguity which caused this
mistake would have been impossible.
Reported-by: George Spelvin <linux@horizon.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Tested-by: George Spelvin <linux@horizon.com>
Diffstat (limited to 'fs/ext4/resize.c')
-rw-r--r-- | fs/ext4/resize.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index 71241bc0eea..101b41c6844 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c @@ -979,7 +979,7 @@ static void update_backups(struct super_block *sb, goto exit_err; } - ext4_superblock_csum_set(sb, (struct ext4_super_block *)data); + ext4_superblock_csum_set(sb); while ((group = ext4_list_backups(sb, &three, &five, &seven)) < last) { struct buffer_head *bh; |