* [PATCH] fs/ext4/super.c: Let 'counters' switched by SMP
@ 2014-07-15 1:05 Chen Gang
2014-07-15 9:31 ` Theodore Ts'o
0 siblings, 1 reply; 6+ messages in thread
From: Chen Gang @ 2014-07-15 1:05 UTC (permalink / raw)
To: Theodore Ts'o, Andreas Dilger
Cc: linux-ext4, linux-kernel@vger.kernel.org
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@gmail.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
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] fs/ext4/super.c: Let 'counters' switched by SMP
2014-07-15 1:05 [PATCH] fs/ext4/super.c: Let 'counters' switched by SMP Chen Gang
@ 2014-07-15 9:31 ` Theodore Ts'o
2014-07-15 10:06 ` Chen Gang
2014-07-21 17:40 ` Olof Johansson
0 siblings, 2 replies; 6+ messages in thread
From: Theodore Ts'o @ 2014-07-15 9:31 UTC (permalink / raw)
To: Chen Gang; +Cc: Andreas Dilger, linux-ext4, linux-kernel@vger.kernel.org
On Tue, Jul 15, 2014 at 09:05:29AM +0800, Chen Gang wrote:
> 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)
Thanks for the pointing out the problem. I though think the right way
of fixing this problem, though, instead of using the #ifdef
CONFIG_SMP, is to do this:
if (percpu_counter_initialized(&EXT4_SB(sb)->s_freeclusters_counter))
...
I'll respin the "ext4: rearrange initialization to fix EXT4FS_DEBUG"
commit to include this fix and give you credit in the commit logs for
pointing out this issue.
Cheers,
- Ted
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] fs/ext4/super.c: Let 'counters' switched by SMP
2014-07-15 9:31 ` Theodore Ts'o
@ 2014-07-15 10:06 ` Chen Gang
2014-07-21 17:40 ` Olof Johansson
1 sibling, 0 replies; 6+ messages in thread
From: Chen Gang @ 2014-07-15 10:06 UTC (permalink / raw)
To: Theodore Ts'o, Andreas Dilger, linux-ext4,
linux-kernel@vger.kernel.org
On 07/15/2014 05:31 PM, Theodore Ts'o wrote:
> On Tue, Jul 15, 2014 at 09:05:29AM +0800, Chen Gang wrote:
>> 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)
>
> Thanks for the pointing out the problem. I though think the right way
> of fixing this problem, though, instead of using the #ifdef
> CONFIG_SMP, is to do this:
>
> if (percpu_counter_initialized(&EXT4_SB(sb)->s_freeclusters_counter))
> ...
>
That sounds fine to me (unlike my ugly fix, your fix is common and
standard), thanks.
> I'll respin the "ext4: rearrange initialization to fix EXT4FS_DEBUG"
> commit to include this fix and give you credit in the commit logs for
> pointing out this issue.
>
Thank you for your work.
Thanks.
--
Chen Gang
Open, share, and attitude like air, water, and life which God blessed
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] fs/ext4/super.c: Let 'counters' switched by SMP
2014-07-15 9:31 ` Theodore Ts'o
2014-07-15 10:06 ` Chen Gang
@ 2014-07-21 17:40 ` Olof Johansson
2014-07-21 19:11 ` Theodore Ts'o
1 sibling, 1 reply; 6+ messages in thread
From: Olof Johansson @ 2014-07-21 17:40 UTC (permalink / raw)
To: Theodore Ts'o, Chen Gang, Andreas Dilger, linux-ext4,
linux-kernel@vger.kernel.org
Hi Ted,
On Tue, Jul 15, 2014 at 2:31 AM, Theodore Ts'o <tytso@mit.edu> wrote:
> On Tue, Jul 15, 2014 at 09:05:29AM +0800, Chen Gang wrote:
>> 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)
>
> Thanks for the pointing out the problem. I though think the right way
> of fixing this problem, though, instead of using the #ifdef
> CONFIG_SMP, is to do this:
>
> if (percpu_counter_initialized(&EXT4_SB(sb)->s_freeclusters_counter))
> ...
>
> I'll respin the "ext4: rearrange initialization to fix EXT4FS_DEBUG"
> commit to include this fix and give you credit in the commit logs for
> pointing out this issue.
Friendly ping, since all !SMP builds in -next seem to be broken by this still.
-Olof
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] fs/ext4/super.c: Let 'counters' switched by SMP
2014-07-21 17:40 ` Olof Johansson
@ 2014-07-21 19:11 ` Theodore Ts'o
2014-07-23 22:55 ` David Rientjes
0 siblings, 1 reply; 6+ messages in thread
From: Theodore Ts'o @ 2014-07-21 19:11 UTC (permalink / raw)
To: Olof Johansson
Cc: Chen Gang, Andreas Dilger, linux-ext4,
linux-kernel@vger.kernel.org
On Mon, Jul 21, 2014 at 10:40:02AM -0700, Olof Johansson wrote:
> > I'll respin the "ext4: rearrange initialization to fix EXT4FS_DEBUG"
> > commit to include this fix and give you credit in the commit logs for
> > pointing out this issue.
>
> Friendly ping, since all !SMP builds in -next seem to be broken by this still.
Right, sorry, I'm currently in vacation in Rome, and the network
connection was really lousy here now that I'm no longer at the ACACES
summer school in Fiuggi. (Also, now that I'm no longer actually
teaching, I've beeen trying to actually do the disconnecting and
sightseeing thing. :-)
Pushed now.
- Ted
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] fs/ext4/super.c: Let 'counters' switched by SMP
2014-07-21 19:11 ` Theodore Ts'o
@ 2014-07-23 22:55 ` David Rientjes
0 siblings, 0 replies; 6+ messages in thread
From: David Rientjes @ 2014-07-23 22:55 UTC (permalink / raw)
To: Theodore Ts'o, Olof Johansson, Chen Gang, Andreas Dilger,
linux-ext4, linux-kernel@vger.kernel.org
On Mon, 21 Jul 2014, Theodore Ts'o wrote:
> Right, sorry, I'm currently in vacation in Rome, and the network
> connection was really lousy here now that I'm no longer at the ACACES
> summer school in Fiuggi. (Also, now that I'm no longer actually
> teaching, I've beeen trying to actually do the disconnecting and
> sightseeing thing. :-)
>
Confirmed this is now fixed in linux-next, thanks Ted!
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-07-23 22:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-15 1:05 [PATCH] fs/ext4/super.c: Let 'counters' switched by SMP Chen Gang
2014-07-15 9:31 ` Theodore Ts'o
2014-07-15 10:06 ` Chen Gang
2014-07-21 17:40 ` Olof Johansson
2014-07-21 19:11 ` Theodore Ts'o
2014-07-23 22:55 ` David Rientjes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).