From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 425C6C433F5 for ; Wed, 10 Nov 2021 10:14:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 14DFB6115B for ; Wed, 10 Nov 2021 10:14:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231126AbhKJKRC (ORCPT ); Wed, 10 Nov 2021 05:17:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230456AbhKJKRB (ORCPT ); Wed, 10 Nov 2021 05:17:01 -0500 Received: from mail-ua1-x92d.google.com (mail-ua1-x92d.google.com [IPv6:2607:f8b0:4864:20::92d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3E66C061764 for ; Wed, 10 Nov 2021 02:14:14 -0800 (PST) Received: by mail-ua1-x92d.google.com with SMTP id v3so3601692uam.10 for ; Wed, 10 Nov 2021 02:14:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=SqXsWUWLuu2Lv2utTh99gbwZolV4BkldqDlDA1egnC8=; b=l7XA1pQhBw6cOkiC1AG35S51Bj0N0dsusjKtYcTDgpRDZsReQAcmomKZqBuMUEsTqh LaCts1qPui4kpYnuf956Zb7slJteFX3QcatRbn8INecCe3RCT3umsNZp2Gxa0Rd1RVYr k2oC+rvWE3Sh9xTpPTlJ/rLqyRdTyqE/DOWcQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=SqXsWUWLuu2Lv2utTh99gbwZolV4BkldqDlDA1egnC8=; b=ZCRPYscd6Z41hNmHNGTIXH3h3c5r1TrfO+fnI5VI+bG+xd/Kjs66V/2NzS5/GR70Li 9ejekW77gnpa3rFpAQoIh5qbRiQBB6oJN5xkjYxNsQrkqNQMDolzoP9hFtT0gXZV23xz ukzyvsZvoV8ACtvqO43Qo9SgNVTg49tNdAyn/mE4MXWsQXF5An2mcUf6AGC8ObITZpFp RSjUDoTt9fKINW7E7zVGMNvsDOpgeMlKAkJnJ2FublJr0juD8PAzXzkiMoH/l7FuBFI9 ZhCw141ACapS0A1fu6GppcD2BtUzcBW1kDEEmobtcUqt9SAaXjxfd32QR6baPNDIh4SA cEsA== X-Gm-Message-State: AOAM530N0P1pz47AykuLybRJJ+h889iPzU0i1sFW0Csds8vOS+kFu5es tEGGqH4BmbUicaRNogo6mn+e8hRAoSHJQACal0o7dnyWiqI= X-Google-Smtp-Source: ABdhPJzs+k7RupuvFwaut3KFRVC7pzrhqyVRA/QoHQm4vfUN9HYD4Msd+OypbK8+Fs5Z92j/KunCfVp9kTTOc2DoJJw= X-Received: by 2002:a67:782:: with SMTP id 124mr46509269vsh.24.1636539253815; Wed, 10 Nov 2021 02:14:13 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Miklos Szeredi Date: Wed, 10 Nov 2021 11:14:02 +0100 Message-ID: Subject: Re: [PATCH] fuse: add a dev ioctl for recovery To: Hao Peng Cc: linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Wed, 10 Nov 2021 at 04:43, Hao Peng wrote: > > On Wed, Sep 8, 2021 at 5:27 PM Hao Peng wrote: > > > > On Wed, Sep 8, 2021 at 5:08 PM Miklos Szeredi wrote= : > > > > > > On Wed, 8 Sept 2021 at 04:25, Hao Peng wrot= e: > > > > > > > > On Tue, Sep 7, 2021 at 5:34 PM Miklos Szeredi w= rote: > > > > > > > > > > On Mon, 6 Sept 2021 at 14:36, Hao Peng = wrote: > > > > > > > > > > > > For a simple read-only file system, as long as the connection > > > > > > is not broken, the recovery of the user-mode read-only file > > > > > > system can be realized by putting the request of the processing > > > > > > list back into the pending list. > > > > > > > > > > Thanks for the patch. > > > > > > > > > > Do you have example userspace code for this? > > > > > > > > > Under development. When the fuse user-mode file system process is a= bnormal, > > > > the process does not terminate (/dev/fuse will not be closed), ente= r > > > > the reset procedure, > > > > and will not open /dev/fuse again during the reinitialization. > > > > Of course, this can only solve part of the abnormal problem. > > > > > > Yes, that's what I'm mainly worried about. Replaying the few > > > currently pending requests is easy, but does that really help in real > > > situations? > > > > > > Much more information is needed about what you are trying to achieve > > > and how, as well as a working userspace implementation to be able to > > > judge this patch. > > > > > I will provide a simple example in a few days. The effect achieved is t= hat the > > user process will not perceive the abnormal restart of the read-only fi= le system > > process based on fuse. > > > > > Thanks, > > > Miklos > Hi=EF=BC=8CI have implemented a small test program to illustrate this new= feature. > After downloading and compiling from > https://github.com/flying-122/libfuse/tree/flying > #gcc -o testfile testfile.c -D_GNU_SOURCE > #./example/passthrough_ll -o debug -s /mnt3 > #./testfile (on another console) > #ps aux | grep pass > #root 34889 0.0 0.0 8848 864 pts/2 S+ 13:10 0:00 > ./example/passthrough_ll -o debug -s /mnt3 > #root 34896 0.0 0.0 9880 128 pts/2 S+ 13:10 0:00 > ./example/passthrough_ll -o debug -s /mnt3 > #root 34913 0.0 0.0 12112 1060 pts/1 S+ 13:10 0:00 > grep --color=3Dauto pass > // kill child process > #kill 34896 > You will see that ./testfile continues to execute without noticing the > abnormal restart of the fuse file system. This is a very good first example demonstrating the limits of the recovery. The only state saved is the actual device file descriptor and the result of the INIT negotiation. It works if there are a fixed number of files, e.g. a read only filesystem, where the files can be enumerated (i.e. a file or directory can be found based on a single 64bit index) Is this your use case? Are you ever planning to extend this to read-write filesystems? Thanks, Miklos