Ver Fonte

Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: don't call jbd2_journal_force_commit_nested without journal
  ext4: Reorder fs/Makefile so that ext2 root fs's are mounted using ext2
  ext4: Remove duplicate call to ext4_commit_super() in ext4_freeze()
Linus Torvalds há 16 anos atrás
pai
commit
36b31106b7
4 ficheiros alterados com 8 adições e 5 exclusões
  1. 4 2
      fs/Makefile
  2. 3 1
      fs/ext4/balloc.c
  3. 1 1
      fs/ext4/inode.c
  4. 0 1
      fs/ext4/super.c

+ 4 - 2
fs/Makefile

@@ -69,10 +69,12 @@ obj-$(CONFIG_DLM)		+= dlm/
 # Do not add any filesystems before this line
 # Do not add any filesystems before this line
 obj-$(CONFIG_REISERFS_FS)	+= reiserfs/
 obj-$(CONFIG_REISERFS_FS)	+= reiserfs/
 obj-$(CONFIG_EXT3_FS)		+= ext3/ # Before ext2 so root fs can be ext3
 obj-$(CONFIG_EXT3_FS)		+= ext3/ # Before ext2 so root fs can be ext3
-obj-$(CONFIG_EXT4_FS)		+= ext4/ # Before ext2 so root fs can be ext4
+obj-$(CONFIG_EXT2_FS)		+= ext2/
+# We place ext4 after ext2 so plain ext2 root fs's are mounted using ext2
+# unless explicitly requested by rootfstype
+obj-$(CONFIG_EXT4_FS)		+= ext4/
 obj-$(CONFIG_JBD)		+= jbd/
 obj-$(CONFIG_JBD)		+= jbd/
 obj-$(CONFIG_JBD2)		+= jbd2/
 obj-$(CONFIG_JBD2)		+= jbd2/
-obj-$(CONFIG_EXT2_FS)		+= ext2/
 obj-$(CONFIG_CRAMFS)		+= cramfs/
 obj-$(CONFIG_CRAMFS)		+= cramfs/
 obj-$(CONFIG_SQUASHFS)		+= squashfs/
 obj-$(CONFIG_SQUASHFS)		+= squashfs/
 obj-y				+= ramfs/
 obj-y				+= ramfs/

+ 3 - 1
fs/ext4/balloc.c

@@ -609,7 +609,9 @@ int ext4_claim_free_blocks(struct ext4_sb_info *sbi,
  */
  */
 int ext4_should_retry_alloc(struct super_block *sb, int *retries)
 int ext4_should_retry_alloc(struct super_block *sb, int *retries)
 {
 {
-	if (!ext4_has_free_blocks(EXT4_SB(sb), 1) || (*retries)++ > 3)
+	if (!ext4_has_free_blocks(EXT4_SB(sb), 1) ||
+	    (*retries)++ > 3 ||
+	    !EXT4_SB(sb)->s_journal)
 		return 0;
 		return 0;
 
 
 	jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id);
 	jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id);

+ 1 - 1
fs/ext4/inode.c

@@ -2544,7 +2544,7 @@ retry:
 
 
 		ext4_journal_stop(handle);
 		ext4_journal_stop(handle);
 
 
-		if (mpd.retval == -ENOSPC) {
+		if ((mpd.retval == -ENOSPC) && sbi->s_journal) {
 			/* commit the transaction which would
 			/* commit the transaction which would
 			 * free blocks released in the transaction
 			 * free blocks released in the transaction
 			 * and try again
 			 * and try again

+ 0 - 1
fs/ext4/super.c

@@ -3091,7 +3091,6 @@ static int ext4_freeze(struct super_block *sb)
 
 
 		/* Journal blocked and flushed, clear needs_recovery flag. */
 		/* Journal blocked and flushed, clear needs_recovery flag. */
 		EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
 		EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
-		ext4_commit_super(sb, EXT4_SB(sb)->s_es, 1);
 		error = ext4_commit_super(sb, EXT4_SB(sb)->s_es, 1);
 		error = ext4_commit_super(sb, EXT4_SB(sb)->s_es, 1);
 		if (error)
 		if (error)
 			goto out;
 			goto out;