linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "zhangxiaoxu (A)" <zhangxiaoxu5@huawei.com>
To: Trond Myklebust <trondmy@hammerspace.com>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
	Anna Schumaker <anna.schumaker@netapp.com>,
	Luo Meng <luomeng12@huawei.com>,
	"zhangyi (F)" <yi.zhang@huawei.com>
Subject: Re: Questions about nfs_sb_active
Date: Thu, 16 Sep 2021 11:48:01 +0800	[thread overview]
Message-ID: <951cd849-d6fe-55c0-6f8d-2fbe3ab348f7@huawei.com> (raw)
In-Reply-To: <30A81685-4F45-44D3-B497-117BF7B33903@hammerspace.com>



在 2021/9/15 21:05, Trond Myklebust 写道:
> 
> 
>> On Sep 15, 2021, at 04:03, zhangxiaoxu (A) <zhangxiaoxu5@huawei.com> wrote:
>>
>> Hi Trond,
>>
>> I have some confuse about 'nfs_sb_active'.
>>
>> The following commit increase the 'sb->s_active' to prevent concurrent with umount process when handle the callback rpc message.
>>
>>   e39d8a186ed0 ("NFSv4: Fix an Oops during delegation callbacks")
>>   113aac6d567b ("NFS: nfs_delegation_find_inode_server must first reference the superblock")
>>
>> But it also delay the process in function 'generic_shutdown_super', such as 'sync_filesystem' and 'fsnotify_sb_delete'.
>>
>> For the common file system, when umount success, the data should be stable to the disk, but in nfs, it maybe delay?
>>
>> I want know :
>>   1. whether we _must_ stable the data to the server?
>>   2. how to ensure the data not lost when umount success but client crash?
>>   3. the delayed fsnotify umount event is reasonable or not?
>>   4. the 'nfs_sb_active' should be used under what scenario?
>>
>> Thanks.
> 
> That has nothing to do with I/O. Delegations are state.
Since the callbacks hold the 'sb->s_active',
the umount maybe return success without shutdown the superblock.

In general, the superblock should be shutdown before umount success,
but in the concurrent scenario, the superblock is shutdown after the callbacks finish.

If the system is crashed in this period, we may lost 'sync_filesystem',
then the page caches (which not flush to server since hold the write delegation when close the file)
and metadata caches maybe lost?

And the 'fsnotify_sb_delete' is also called after the callbacks finish.
IOW, the umount already return with success, but the FS_UNMOUNT event maybe delay?

I have no idea about it is reasonable or not.
> 
> _________________________________
> Trond Myklebust
> Linux NFS client maintainer, Hammerspace
> trond.myklebust@hammerspace.com
> 
> .
> 

  reply	other threads:[~2021-09-16  3:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15  8:03 Questions about nfs_sb_active zhangxiaoxu (A)
2021-09-15 13:05 ` Trond Myklebust
2021-09-16  3:48   ` zhangxiaoxu (A) [this message]
2021-09-16 14:23     ` Trond Myklebust

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=951cd849-d6fe-55c0-6f8d-2fbe3ab348f7@huawei.com \
    --to=zhangxiaoxu5@huawei.com \
    --cc=anna.schumaker@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=luomeng12@huawei.com \
    --cc=trondmy@hammerspace.com \
    --cc=yi.zhang@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).