Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org>
Cc: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-cifs <linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] cifs: update comments - [s/GlobalSMBSesLock/cifs_file_list_lock/g]
Date: Mon, 18 Oct 2010 14:38:32 -0400	[thread overview]
Message-ID: <20101018143832.675f5be3@corrin.poochiereds.net> (raw)
In-Reply-To: <4CBC905A.5060007-l3A5Bk7waGM@public.gmane.org>

On Mon, 18 Oct 2010 23:52:18 +0530
Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote:

> GlobalSMBSesLock is now cifs_file_list_lock. Update comments to reflect this.
> 
> OTOH, isn't there is a cleaner way instead of acquiring spin_lock and doing
> spin_unlock in succession in cifs_oplock_break to ensure we already grabbed
> the reference? Is this really needed?
> 
> Signed-off-by: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org>

I wish there were -- it's certainly ugly.

We need to make sure we have references held for the oplock break
workqueue job. Typically, we'd take those references first and then
queue the work. If something goes wrong however and we can't queue that
job, then we'd have to ensure that we put those references.

There's a problem here though, is_valid_oplock_break is run in cifsd
thread. If we end up putting the references in this context, we can end
up tearing things down and doing blocking SMB calls. If cifsd does
that, it'll deadlock.

We could (in principle) add a completion variable or something for
this, but the lock/unlock works just as well for this purpose.

Comment fix looks fine:

Reviewed-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

      parent reply	other threads:[~2010-10-18 18:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-18 18:22 [PATCH] cifs: update comments - [s/GlobalSMBSesLock/cifs_file_list_lock/g] Suresh Jayaraman
     [not found] ` <4CBC905A.5060007-l3A5Bk7waGM@public.gmane.org>
2010-10-18 18:38   ` Jeff Layton [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=20101018143832.675f5be3@corrin.poochiereds.net \
    --to=jlayton-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sjayaraman-l3A5Bk7waGM@public.gmane.org \
    --cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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