aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/namei.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@us.ibm.com>2012-04-29 18:29:10 -0400
committerTheodore Ts'o <tytso@mit.edu>2012-04-29 18:29:10 -0400
commita9c4731780544d52b243bf46e4dd635c67fa9f84 (patch)
treedc735f2f59fa2107e8fed8e3d26f259557e34008 /fs/ext4/namei.c
parent0441984a3398970ab4820410b9cf4ff85bf3a6b0 (diff)
ext4: calculate and verify superblock checksum
Calculate and verify the superblock checksum. Since the UUID and block group number are embedded in each copy of the superblock, we need only checksum the entire block. Refactor some of the code to eliminate open-coding of the checksum update call. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r--fs/ext4/namei.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index b58bd5c8ffe7..625125172d05 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2021,7 +2021,7 @@ int ext4_orphan_add(handle_t *handle, struct inode *inode)
2021 /* Insert this inode at the head of the on-disk orphan list... */ 2021 /* Insert this inode at the head of the on-disk orphan list... */
2022 NEXT_ORPHAN(inode) = le32_to_cpu(EXT4_SB(sb)->s_es->s_last_orphan); 2022 NEXT_ORPHAN(inode) = le32_to_cpu(EXT4_SB(sb)->s_es->s_last_orphan);
2023 EXT4_SB(sb)->s_es->s_last_orphan = cpu_to_le32(inode->i_ino); 2023 EXT4_SB(sb)->s_es->s_last_orphan = cpu_to_le32(inode->i_ino);
2024 err = ext4_handle_dirty_metadata(handle, NULL, EXT4_SB(sb)->s_sbh); 2024 err = ext4_handle_dirty_super_now(handle, sb);
2025 rc = ext4_mark_iloc_dirty(handle, inode, &iloc); 2025 rc = ext4_mark_iloc_dirty(handle, inode, &iloc);
2026 if (!err) 2026 if (!err)
2027 err = rc; 2027 err = rc;
@@ -2094,7 +2094,7 @@ int ext4_orphan_del(handle_t *handle, struct inode *inode)
2094 if (err) 2094 if (err)
2095 goto out_brelse; 2095 goto out_brelse;
2096 sbi->s_es->s_last_orphan = cpu_to_le32(ino_next); 2096 sbi->s_es->s_last_orphan = cpu_to_le32(ino_next);
2097 err = ext4_handle_dirty_metadata(handle, NULL, sbi->s_sbh); 2097 err = ext4_handle_dirty_super_now(handle, inode->i_sb);
2098 } else { 2098 } else {
2099 struct ext4_iloc iloc2; 2099 struct ext4_iloc iloc2;
2100 struct inode *i_prev = 2100 struct inode *i_prev =