All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@primarydata.com>
To: Peng Tao <tao.peng@primarydata.com>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 1/5] NFSv4: Ensure we reference the inode for return-on-close in delegreturn
Date: Thu, 5 Feb 2015 21:53:09 -0500	[thread overview]
Message-ID: <CAHQdGtQCLpWwV+wdu0-nyrrmemXYgsJWKqiU5yXmmZUYj2RHpg@mail.gmail.com> (raw)
In-Reply-To: <CAKVebiVX7Nd76_byoDgaZfP6ojVZ_WZ_rHu8T+K9TnrCphJ8wA@mail.gmail.com>

On Thu, Feb 5, 2015 at 8:57 PM, Peng Tao <tao.peng@primarydata.com> wrote:
>
> On Fri, Feb 6, 2015 at 9:45 AM, Peng Tao <tao.peng@primarydata.com> wrote:
> > On Fri, Feb 6, 2015 at 6:37 AM, Trond Myklebust
> > <trond.myklebust@primarydata.com> wrote:
> >> If we have to do a return-on-close in the delegreturn code, then
> >> we must ensure that the inode and super block remain referenced.
> >>
> ah, a second thought. I looked for call sites of nfs_sb_active() and
> it gets called at five places in current tree:
> alloc_nfs_open_context, nfs4_opendata_alloc, nfs4_do_close,
> nfs_do_call_unlink, nfs_do_call_unlink
>
> So it appears that sb is activated while any file keeps opened and
> between unlink calls. Then it looks that we are allowed to keep
> delegations after sb is released? Maybe the best way to fix the sb
> reference part is to pin sb when getting the first delegation.

The superblock reference is only there in order to allow us to perform
asynchronous delegreturns without any danger. The problem here is that
we'd end up pinning the superblock even after umount if there are
still unreturned delegations.
That said, I do see that there is a problem with calling
nfs_sb_active() when sb->s_active is zero, so I think I'd like to fix
that up.

-- 
Trond Myklebust
Linux NFS client maintainer, PrimaryData
trond.myklebust@primarydata.com

  reply	other threads:[~2015-02-06  2:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-05 22:37 [PATCH 1/5] NFSv4: Ensure we reference the inode for return-on-close in delegreturn Trond Myklebust
2015-02-05 22:37 ` [PATCH 2/5] NFSv4.1: Pin the inode and super block in asynchronous layoutcommit Trond Myklebust
2015-02-05 22:37   ` [PATCH 3/5] NFSv4.1: Pin the inode and super block in asynchronous layoutreturns Trond Myklebust
2015-02-05 22:37     ` [PATCH 4/5] NFSv4.1: pnfs_send_layoutreturn should use GFP_NOFS Trond Myklebust
2015-02-05 22:37       ` [PATCH 5/5] NFSv4.1: Fix pnfs_put_lseg races Trond Myklebust
2015-02-06  2:03   ` [PATCH 2/5] NFSv4.1: Pin the inode and super block in asynchronous layoutcommit Peng Tao
2015-02-06  1:45 ` [PATCH 1/5] NFSv4: Ensure we reference the inode for return-on-close in delegreturn Peng Tao
2015-02-06  1:57   ` Peng Tao
2015-02-06  2:53     ` Trond Myklebust [this message]
2015-02-06  3:05       ` Peng Tao
2015-02-06  2:54     ` Peng Tao

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=CAHQdGtQCLpWwV+wdu0-nyrrmemXYgsJWKqiU5yXmmZUYj2RHpg@mail.gmail.com \
    --to=trond.myklebust@primarydata.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=tao.peng@primarydata.com \
    /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.