All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: Marco Stornelli <marco.stornelli@gmail.com>
Cc: Jan Kara <jack@suse.cz>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Al Viro <viro@zeniv.linux.org.uk>, Josef Bacik <josef@redhat.com>
Subject: Re: [PATCH v2] Fix AFFS race condition.
Date: Mon, 14 May 2012 12:54:30 +0200	[thread overview]
Message-ID: <4FB0E466.9050905@gmail.com> (raw)
In-Reply-To: <CANGUGtA=XfraVL28YqAM0t3oMjfud0Fn1VtJNxwt8=reG10nGA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1137 bytes --]

On 14.05.2012 12:40, Marco Stornelli wrote:

> 2012/5/14 Jan Kara <jack@suse.cz>:
>> On Sun 13-05-12 15:44:33, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>>> AFFS code preallocates several blocks as an optimisation. Unfortunately
>>> it's not protected by lock so the same blocks may end up allocated twice.
>>> Here is a fix.
>>>
>>> Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
>>  The patch looks good to me now. Thanks! You can add:
>> Reviewed-by: Jan Kara <jack@suse.cz>
>>
>>  Al, will you merge this patch through your tree? AFFS does not seem to
>> have a maintainer so you are a default fallback...
>>
>>                                                                Honza
>>
> 
> I don't know the AFFS code, so only a question. Instead to use a spin
> lock, I think we can use a simple mutex. Or is the spin lock
> mandatory?

My first version used mutex. But then Jan suggested that since the
critical section is very short and doesn't contain any instructions
which might sleep, it's better for performance to use a spin lock.

-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

      parent reply	other threads:[~2012-05-14 10:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-13 13:44 [PATCH v2] Fix AFFS race condition Vladimir 'φ-coder/phcoder' Serbinenko
2012-05-14  9:45 ` Jan Kara
2012-05-14 10:40   ` Marco Stornelli
2012-05-14 10:40     ` Marco Stornelli
2012-05-14 10:53     ` Jan Kara
2012-05-14 10:53       ` Jan Kara
2012-05-14 11:06       ` Marco Stornelli
2012-05-14 11:06         ` Marco Stornelli
2012-05-14 10:54     ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]

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=4FB0E466.9050905@gmail.com \
    --to=phcoder@gmail.com \
    --cc=jack@suse.cz \
    --cc=josef@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marco.stornelli@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.