lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 15 Jul 2014 09:05:29 +0800
From:	Chen Gang <gang.chen.5i5j@...il.com>
To:	Theodore Ts'o <tytso@....edu>,
	Andreas Dilger <adilger.kernel@...ger.ca>
CC:	linux-ext4@...r.kernel.org,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH] fs/ext4/super.c: Let 'counters' switched by SMP

When SMP is disabled, 'struct percpu_counter' has no 'counters' member,
so need skip it when in !SMP.

The related git commit:

  "feab139 ext4: rearrange initialization to fix EXT4FS_DEBUG".

The related error (with allmodconfig under score):

    CC [M]  fs/ext4/super.o
  fs/ext4/super.c: In function 'ext4_commit_super':
  fs/ext4/super.c:4546:41: error: 'struct percpu_counter' has no member named 'counters'
    if (EXT4_SB(sb)->s_freeclusters_counter.counters)
                                           ^
  fs/ext4/super.c:4550:39: error: 'struct percpu_counter' has no member named 'counters'
    if (EXT4_SB(sb)->s_freeinodes_counter.counters)
                                         ^

Signed-off-by: Chen Gang <gang.chen.5i5j@...il.com>
---
 fs/ext4/super.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 30767cd..3cd4fe1 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4543,11 +4543,15 @@ static int ext4_commit_super(struct super_block *sb, int sync)
 	else
 		es->s_kbytes_written =
 			cpu_to_le64(EXT4_SB(sb)->s_kbytes_written);
+#ifdef CONFIG_SMP
 	if (EXT4_SB(sb)->s_freeclusters_counter.counters)
+#endif
 		ext4_free_blocks_count_set(es,
 			EXT4_C2B(EXT4_SB(sb), percpu_counter_sum_positive(
 				&EXT4_SB(sb)->s_freeclusters_counter)));
+#ifdef CONFIG_SMP
 	if (EXT4_SB(sb)->s_freeinodes_counter.counters)
+#endif
 		es->s_free_inodes_count =
 			cpu_to_le32(percpu_counter_sum_positive(
 				&EXT4_SB(sb)->s_freeinodes_counter));
-- 
1.9.2.459.g68773ac
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ