aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/super.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index aa22acd6eb06..64fc7f111734 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -665,18 +665,20 @@ static inline void ext4_show_quota_options(struct seq_file *seq, struct super_bl
665 */ 665 */
666static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs) 666static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
667{ 667{
668 int def_errors;
669 unsigned long def_mount_opts;
668 struct super_block *sb = vfs->mnt_sb; 670 struct super_block *sb = vfs->mnt_sb;
669 struct ext4_sb_info *sbi = EXT4_SB(sb); 671 struct ext4_sb_info *sbi = EXT4_SB(sb);
670 struct ext4_super_block *es = sbi->s_es; 672 struct ext4_super_block *es = sbi->s_es;
671 unsigned long def_mount_opts;
672 673
673 def_mount_opts = le32_to_cpu(es->s_default_mount_opts); 674 def_mount_opts = le32_to_cpu(es->s_default_mount_opts);
675 def_errors = le16_to_cpu(es->s_errors);
674 676
675 if (sbi->s_sb_block != 1) 677 if (sbi->s_sb_block != 1)
676 seq_printf(seq, ",sb=%llu", sbi->s_sb_block); 678 seq_printf(seq, ",sb=%llu", sbi->s_sb_block);
677 if (test_opt(sb, MINIX_DF)) 679 if (test_opt(sb, MINIX_DF))
678 seq_puts(seq, ",minixdf"); 680 seq_puts(seq, ",minixdf");
679 if (test_opt(sb, GRPID)) 681 if (test_opt(sb, GRPID) && !(def_mount_opts & EXT4_DEFM_BSDGROUPS))
680 seq_puts(seq, ",grpid"); 682 seq_puts(seq, ",grpid");
681 if (!test_opt(sb, GRPID) && (def_mount_opts & EXT4_DEFM_BSDGROUPS)) 683 if (!test_opt(sb, GRPID) && (def_mount_opts & EXT4_DEFM_BSDGROUPS))
682 seq_puts(seq, ",nogrpid"); 684 seq_puts(seq, ",nogrpid");
@@ -689,25 +691,24 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
689 seq_printf(seq, ",resgid=%u", sbi->s_resgid); 691 seq_printf(seq, ",resgid=%u", sbi->s_resgid);
690 } 692 }
691 if (test_opt(sb, ERRORS_RO)) { 693 if (test_opt(sb, ERRORS_RO)) {
692 int def_errors = le16_to_cpu(es->s_errors);
693
694 if (def_errors == EXT4_ERRORS_PANIC || 694 if (def_errors == EXT4_ERRORS_PANIC ||
695 def_errors == EXT4_ERRORS_CONTINUE) { 695 def_errors == EXT4_ERRORS_CONTINUE) {
696 seq_puts(seq, ",errors=remount-ro"); 696 seq_puts(seq, ",errors=remount-ro");
697 } 697 }
698 } 698 }
699 if (test_opt(sb, ERRORS_CONT)) 699 if (test_opt(sb, ERRORS_CONT) && def_errors != EXT4_ERRORS_CONTINUE)
700 seq_puts(seq, ",errors=continue"); 700 seq_puts(seq, ",errors=continue");
701 if (test_opt(sb, ERRORS_PANIC)) 701 if (test_opt(sb, ERRORS_PANIC) && def_errors != EXT4_ERRORS_PANIC)
702 seq_puts(seq, ",errors=panic"); 702 seq_puts(seq, ",errors=panic");
703 if (test_opt(sb, NO_UID32)) 703 if (test_opt(sb, NO_UID32) && !(def_mount_opts & EXT4_DEFM_UID16))
704 seq_puts(seq, ",nouid32"); 704 seq_puts(seq, ",nouid32");
705 if (test_opt(sb, DEBUG)) 705 if (test_opt(sb, DEBUG) && !(def_mount_opts & EXT4_DEFM_DEBUG))
706 seq_puts(seq, ",debug"); 706 seq_puts(seq, ",debug");
707 if (test_opt(sb, OLDALLOC)) 707 if (test_opt(sb, OLDALLOC))
708 seq_puts(seq, ",oldalloc"); 708 seq_puts(seq, ",oldalloc");
709#ifdef CONFIG_EXT4DEV_FS_XATTR 709#ifdef CONFIG_EXT4DEV_FS_XATTR
710 if (test_opt(sb, XATTR_USER)) 710 if (test_opt(sb, XATTR_USER) &&
711 !(def_mount_opts & EXT4_DEFM_XATTR_USER))
711 seq_puts(seq, ",user_xattr"); 712 seq_puts(seq, ",user_xattr");
712 if (!test_opt(sb, XATTR_USER) && 713 if (!test_opt(sb, XATTR_USER) &&
713 (def_mount_opts & EXT4_DEFM_XATTR_USER)) { 714 (def_mount_opts & EXT4_DEFM_XATTR_USER)) {
@@ -715,7 +716,7 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
715 } 716 }
716#endif 717#endif
717#ifdef CONFIG_EXT4DEV_FS_POSIX_ACL 718#ifdef CONFIG_EXT4DEV_FS_POSIX_ACL
718 if (test_opt(sb, POSIX_ACL)) 719 if (test_opt(sb, POSIX_ACL) && !(def_mount_opts & EXT4_DEFM_ACL))
719 seq_puts(seq, ",acl"); 720 seq_puts(seq, ",acl");
720 if (!test_opt(sb, POSIX_ACL) && (def_mount_opts & EXT4_DEFM_ACL)) 721 if (!test_opt(sb, POSIX_ACL) && (def_mount_opts & EXT4_DEFM_ACL))
721 seq_puts(seq, ",noacl"); 722 seq_puts(seq, ",noacl");
@@ -735,6 +736,10 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
735 if (test_opt(sb, I_VERSION)) 736 if (test_opt(sb, I_VERSION))
736 seq_puts(seq, ",i_version"); 737 seq_puts(seq, ",i_version");
737 738
739 /*
740 * journal mode get enabled in different ways
741 * So just print the value even if we didn't specify it
742 */
738 if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) 743 if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)
739 seq_puts(seq, ",data=journal"); 744 seq_puts(seq, ",data=journal");
740 else if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA) 745 else if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA)
@@ -743,7 +748,6 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
743 seq_puts(seq, ",data=writeback"); 748 seq_puts(seq, ",data=writeback");
744 749
745 ext4_show_quota_options(seq, sb); 750 ext4_show_quota_options(seq, sb);
746
747 return 0; 751 return 0;
748} 752}
749 753