All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Winchester <kjwinchester@gmail.com>
To: Daniel Walker <dwalker@mvista.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Possible locking issue in viotape.c
Date: Sat, 08 Dec 2007 14:17:41 -0400	[thread overview]
Message-ID: <475ADFC5.4030108@gmail.com> (raw)
In-Reply-To: <1196991637.1568.140.camel@jnielson-xp.ddns.mvista.com>

Daniel Walker wrote:
> On Thu, 2007-12-06 at 21:29 -0400, Kevin Winchester wrote:
>> Daniel Walker wrote:
>>> I've posted all the ones I've done so far ..
>>>
>>> ftp://source.mvista.com/pub/dwalker/sem2mutex-2.6.24-rc4/
>>>
>>> Feel free to review or test them.. I've found it pretty easy to simply
>>> grep for certain class of semaphore usage, check if it's conforming to
>>> the mutex requirements, then convert it or not.. Checking them is
>>> getting to be a habit, so I don't think a list would help me.. However,
>>> someone else might be able to use it..
>>>
>> Thanks, that helps me not duplicate anything.  One of the first ones I
>> was looking at (before your post) was viotape.c, which is in your patch
>> set.  However, looking at the uses of the semaphore, I see that on line
>> 409-410 the following code:
>>
>>         if (noblock)
>>                 return count;
>>
>> which seems to ignore the fact that the semaphore has been downed (not
>> to mention the dma buffer and op struct allocations.  I think it should be:
>>
>> 	if (noblock)
>> 		ret = count;
>> 		goto free_dma;
>>
>> instead.  Do you want to make sure I'm right about that and fold it into
>> your patch?  Or have you already submitted your patch (or should it be
>> in a separate patch?  Alternatively, I can submit the patch if you don't
>> want to bother with it.
> 
> viotape was one of the first I started converting, but later I noticed
> the same thing you found above. I have it commented out of my series for
> that reason ..
> 
> I think this noblock path is actually doing what the author intended..
> There are a few stray up() calls related to event handling and ioctls ,
> and I think those are used to release the semaphore..
> 
> Daniel
> 
> 

Yes, you are right, I hadn't finished looking at all of the up() calls
when I came to my conclusion.  I will try to convert a few that are not
on your list, but I would like to know how you are generating your
patches into those files with the diffstat and recipient list.  Is that
a feature of some git command?

-- 
Kevin Winchester

  reply	other threads:[~2007-12-08 18:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-05  8:00 [PATCH 1/3] stopmachine semaphore to mutex Daniel Walker
2007-12-05  8:00 ` Daniel Walker
2007-12-05  8:00 ` [PATCH 2/3] Amiga serial driver: port_write_mutex fixup Daniel Walker
2007-12-05  8:00 ` [PATCH 3/3] printer port driver: semaphore to mutex Daniel Walker
2007-12-06 10:23   ` Ingo Molnar
2007-12-06 16:34     ` Daniel Walker
2007-12-06 20:01       ` Remy Bohmer
2007-12-06 20:12         ` Daniel Walker
2007-12-06 20:40           ` Remy Bohmer
2007-12-06 20:05       ` Matthias Kaehlcke
2007-12-06 20:12         ` Remy Bohmer
2007-12-06 20:23           ` Daniel Walker
2007-12-07  7:40           ` Matthias Kaehlcke
2007-12-06 20:44       ` Ingo Molnar
2007-12-06 23:30       ` Kevin Winchester
2007-12-07  1:05         ` Daniel Walker
2007-12-07  1:29           ` Possible locking issue in viotape.c Kevin Winchester
2007-12-07  1:40             ` Daniel Walker
2007-12-08 18:17               ` Kevin Winchester [this message]
2007-12-08 18:22                 ` Daniel Walker
2007-12-08 19:19                   ` Kevin Winchester
2007-12-08 19:45                     ` Daniel Walker
2007-12-06 10:22 ` [PATCH 1/3] stopmachine semaphore to mutex Ingo Molnar

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=475ADFC5.4030108@gmail.com \
    --to=kjwinchester@gmail.com \
    --cc=dwalker@mvista.com \
    --cc=linux-kernel@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.