public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chen Gang <gang.chen.5i5j@gmail.com>
To: "Theodore Ts'o" <tytso@mit.edu>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	linux-ext4@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fs/ext4/super.c: Let 'counters' switched by SMP
Date: Tue, 15 Jul 2014 18:06:31 +0800	[thread overview]
Message-ID: <53C4FD27.2030906@gmail.com> (raw)
In-Reply-To: <20140715093154.GB1451@thunk.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

  reply	other threads:[~2014-07-15 10:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2014-07-21 17:40   ` Olof Johansson
2014-07-21 19:11     ` Theodore Ts'o
2014-07-23 22:55       ` David Rientjes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53C4FD27.2030906@gmail.com \
    --to=gang.chen.5i5j@gmail.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox