Commit d3ba7afc authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'ext4_for_linus_bugfixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

Pull ext4 fixes from Ted Ts'o:
 "Two ext4 bug fixes, one being a revert of a commit sent during the
  merge window"

* tag 'ext4_for_linus_bugfixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  Revert "ext4: fix superblock checksum calculation race"
  ext4: handle dax mount option collision
parents 585e5b17 d196e229
...@@ -1231,13 +1231,13 @@ struct ext4_inode_info { ...@@ -1231,13 +1231,13 @@ struct ext4_inode_info {
blocks */ blocks */
#define EXT4_MOUNT2_HURD_COMPAT 0x00000004 /* Support HURD-castrated #define EXT4_MOUNT2_HURD_COMPAT 0x00000004 /* Support HURD-castrated
file systems */ file systems */
#define EXT4_MOUNT2_DAX_NEVER 0x00000008 /* Do not allow Direct Access */
#define EXT4_MOUNT2_DAX_INODE 0x00000010 /* For printing options only */
#define EXT4_MOUNT2_EXPLICIT_JOURNAL_CHECKSUM 0x00000008 /* User explicitly #define EXT4_MOUNT2_EXPLICIT_JOURNAL_CHECKSUM 0x00000008 /* User explicitly
specified journal checksum */ specified journal checksum */
#define EXT4_MOUNT2_JOURNAL_FAST_COMMIT 0x00000010 /* Journal fast commit */ #define EXT4_MOUNT2_JOURNAL_FAST_COMMIT 0x00000010 /* Journal fast commit */
#define EXT4_MOUNT2_DAX_NEVER 0x00000020 /* Do not allow Direct Access */
#define EXT4_MOUNT2_DAX_INODE 0x00000040 /* For printing options only */
#define clear_opt(sb, opt) EXT4_SB(sb)->s_mount_opt &= \ #define clear_opt(sb, opt) EXT4_SB(sb)->s_mount_opt &= \
~EXT4_MOUNT_##opt ~EXT4_MOUNT_##opt
......
...@@ -289,18 +289,7 @@ void ext4_superblock_csum_set(struct super_block *sb) ...@@ -289,18 +289,7 @@ void ext4_superblock_csum_set(struct super_block *sb)
if (!ext4_has_metadata_csum(sb)) if (!ext4_has_metadata_csum(sb))
return; return;
/*
* Locking the superblock prevents the scenario
* where:
* 1) a first thread pauses during checksum calculation.
* 2) a second thread updates the superblock, recalculates
* the checksum, and updates s_checksum
* 3) the first thread resumes and finishes its checksum calculation
* and updates s_checksum with a potentially stale or torn value.
*/
lock_buffer(EXT4_SB(sb)->s_sbh);
es->s_checksum = ext4_superblock_csum(sb, es); es->s_checksum = ext4_superblock_csum(sb, es);
unlock_buffer(EXT4_SB(sb)->s_sbh);
} }
ext4_fsblk_t ext4_block_bitmap(struct super_block *sb, ext4_fsblk_t ext4_block_bitmap(struct super_block *sb,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment