On Fri, Feb 6, 2015 at 10:53 AM, Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx> wrote: > On Thu, Feb 5, 2015 at 8:57 PM, Peng Tao <tao.peng@xxxxxxxxxxxxxxx> wrote: >> >> On Fri, Feb 6, 2015 at 9:45 AM, Peng Tao <tao.peng@xxxxxxxxxxxxxxx> wrote: >> > On Fri, Feb 6, 2015 at 6:37 AM, Trond Myklebust >> > <trond.myklebust@xxxxxxxxxxxxxxx> 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. yeah, I see your point. Thanks for the explanation. Cheers, Tao > > -- > Trond Myklebust > Linux NFS client maintainer, PrimaryData > trond.myklebust@xxxxxxxxxxxxxxx -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html