mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Marcelo Tosatti <marcelo@conectiva.com.br>
Cc: linux-kernel@vger.kernel.org, matthew@wil.cx, michael.kerrisk@gmx.net
Subject: Re: [PATCH] [2.4.20-pre2] File lease fixes
Date: Tue, 13 Aug 2002 15:09:29 +1000	[thread overview]
Message-ID: <20020813150929.2770f9d4.sfr@canb.auug.org.au> (raw)
In-Reply-To: <Pine.LNX.4.44.0208122346260.3620-100000@freak.distro.conectiva>

Hi Marcelo,

On Mon, 12 Aug 2002 23:47:03 -0300 (BRT) Marcelo Tosatti <marcelo@conectiva.com.br> wrote:
>
> On Tue, 13 Aug 2002, Stephen Rothwell wrote:
> 
> >  static inline int get_lease(struct inode *inode, unsigned int mode)
> >  {
> > -	if (inode->i_flock && (inode->i_flock->fl_flags & FL_LEASE))
> > +	if (inode->i_flock)
> >  		return __get_lease(inode, mode);
> >  	return 0;
> >  }
> 
> Why do you remove the FL_LEASE check here?

Because there is a race between checking inode->i_flock and
inode->i_flock->fl_flags which a couple of people have actually
hit ... The check for FL_EASE is done again in __get_lease
but protected by the BKL.

This is just an optimisation and having the check here is only
faster in the case where there is a lock held that is NOT a lease.

This was the race fix provided by Willy.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

      reply	other threads:[~2002-08-13  5:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-13  1:10 Stephen Rothwell
2002-08-13  2:47 ` Marcelo Tosatti
2002-08-13  5:09   ` Stephen Rothwell [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=20020813150929.2770f9d4.sfr@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=matthew@wil.cx \
    --cc=michael.kerrisk@gmx.net \
    /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

all inboxes | Powered by JetHome®