mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Shirish Pargaonkar" <shirishpargaonkar@gmail.com>
To: "Arjan van de Ven" <arjan@infradead.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: valid task structure and wake_up_process
Date: Mon, 14 Apr 2008 15:01:38 -0500	[thread overview]
Message-ID: <4a4634330804141301l69d29e32wefa1ceb4ec75ec57@mail.gmail.com> (raw)
In-Reply-To: <20080414121105.5f9e5482@laptopd505.fenrus.org>

On 4/14/08, Arjan van de Ven <arjan@infradead.org> wrote:
> On Mon, 14 Apr 2008 13:36:42 -0500
> "Shirish Pargaonkar" <shirishpargaonkar@gmail.com> wrote:
>
> > How do I check whether a task is valid before calling
> > wake_up_process() with that task structure pointer?
>
> Hi,
>
> how did you get the pointer you got?
>
> That part (the guy who gave you the pointer) should have taken a reference on the task basically,
> or otherwise locked against the task going away.
>
> In giving you advice it would help tremendously if you actually posted your code...
>
>
>
>
>
> --
> If you want to reach me at my work email, use arjan@linux.intel.com
> For development, discussion and tips for power savings,
> visit http://www.lesswatts.org
>

Thanks.

This is cifs code fs/cifs.

In cifs_demultiplex_thread, in fs/cifs/connect.c, it calls wake_up_process in
a thread cifsd.

The task struct ptr is stored in mid as current when sending a request.  So this
could a command such as ls or some other application.
A request was sent but a reply was not received or reply was processed late
before the process went away and we have a probably freed task structure
being treated as valid in cifs_demultiplex_thread.

So I thought of checking validity of task structure before calling
wake_up_process.

Regards,

Shirish

      reply	other threads:[~2008-04-14 20:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-14 18:36 Shirish Pargaonkar
2008-04-14 19:11 ` Arjan van de Ven
2008-04-14 20:01   ` Shirish Pargaonkar [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=4a4634330804141301l69d29e32wefa1ceb4ec75ec57@mail.gmail.com \
    --to=shirishpargaonkar@gmail.com \
    --cc=arjan@infradead.org \
    --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 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®