All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wendy Cheng <wcheng@redhat.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: NFS list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] Fix NLM reference count panic
Date: Sat, 05 Jan 2008 12:46:21 -0500	[thread overview]
Message-ID: <477FC26D.5010505@redhat.com> (raw)
In-Reply-To: <20080105060509.GA29020@fieldses.org>

J. Bruce Fields wrote:

>On Sat, Jan 05, 2008 at 12:03:07AM -0500, Wendy Cheng wrote:
>  
>
>>J. Bruce Fields wrote:
>>
>>    
>>
>>>On Fri, Jan 04, 2008 at 05:48:49PM -0500, Wendy Cheng wrote:
>>>This just replaces the file->f_locks check by a search of the inode's
>>>lock list.
>>>
>>>What confuses me here is that the nlm_inspect_file() call just above
>>>already did that search, and set file->f_locks accordingly.  The only
>>>difference is that now we've acquired the nlm_file_mutex.  I don't
>>>understand yet how that makes a difference.
>>>
>>> 
>>>      
>>>
>>You're right. I got the patch sequence wrong. It will cause panic only when 
>>we selectively unlock nlm locks under my "unlock" patch as the following. 
>>See how it returns without doing nlm_traverse_locks() below ... Let's 
>>combine this patch into the big unlock patch so we won't have any 
>>confusion. The unlock patch will submitted on Monday after this weekend's 
>>sanity check test run. In short, I withdraw this patch... Wendy
>>    
>>
>
>OK.  I'll admit to still being a little confused--but with luck it'll
>all make sense when I see the whole thing.  Have a good weekend!
>
>  
>
Actually the *existing* logic (implying without my changes) is awkward. 
It uses file->f_locks to carry the result of unlock operation. Leave the 
non-zero f_locks value hanging there if unlock fails, It only resets it 
back to zero when next time nlm_inspect_file is called. Code like this 
is a good place to generate subtle race conditions that could result 
with file close failure. Just a complaint - I don't have a solid proof 
that it has caused troubles though.

Anyway, will combine this small patch into the big unlock patch. You 
have a good weekend too !

-- Wendy

  reply	other threads:[~2008-01-05 17:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-04 22:48 [PATCH] Fix NLM reference count panic Wendy Cheng
2008-01-04 22:58 ` Wendy Cheng
2008-01-04 23:24 ` J. Bruce Fields
2008-01-05  5:03   ` Wendy Cheng
2008-01-05  6:05     ` J. Bruce Fields
2008-01-05 17:46       ` Wendy Cheng [this message]
2008-01-05 17:36         ` J. Bruce Fields

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=477FC26D.5010505@redhat.com \
    --to=wcheng@redhat.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    /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.