All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Van Hensbergen <ericvh@kernel.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: v9fs-developer@lists.sourceforge.net, asmadeus@codewreck.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux_oss@crudebyte.com
Subject: Re: [PATCH v5] fs/9p: remove writeback fid and fix per-file modes
Date: Tue, 25 Apr 2023 17:01:03 -0700	[thread overview]
Message-ID: <CAFkjPT=-EvCf1HKT2-k73G4SVBwRDp=YtvfwhNAcjv6BzS4f9Q@mail.gmail.com> (raw)
In-Reply-To: <7686c810-4ed6-9e3a-3714-8b803e2d3c46@wanadoo.fr>

I swear I fixed that, must have been one of my fixes got dropped in
the process of churning over this patch.  I'm quite concerned that
this is coming up during the merge window because I'd really rather
not punt this patch series another two months.  I'm going to apply the
fix as an additional patch which hopefully Linus will accept with the
rest of the series.

On Tue, Apr 25, 2023 at 12:11 AM Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
>
> Le 27/03/2023 à 04:59, Eric Van Hensbergen a écrit :
> > This patch removes the creating of an additional writeback_fid
> > for opened files.  The patch addresses problems when files
> > were opened write-only or getattr on files with dirty caches.
> >
> > This patch also incorporates information about cache behavior
> > in the fid for every file.  This allows us to reflect cache
> > behavior from mount flags, open mode, and information from
> > the server to inform readahead and writeback behavior.
> >
> > This includes adding support for a 9p semantic that qid.version==0
> > is used to mark a file as non-cachable which is important for
> > synthetic files.  This may have a side-effect of not supporting
> > caching on certain legacy file servers that do not properly set
> > qid.version.  There is also now a mount flag which can disable
> > the qid.version behavior.
> >
> > Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org>
> > ---
> >   fs/9p/fid.c            | 48 +++++++++-------------
> >   fs/9p/fid.h            | 33 ++++++++++++++-
> >   fs/9p/v9fs.h           |  1 -
> >   fs/9p/vfs_addr.c       | 22 +++++-----
> >   fs/9p/vfs_file.c       | 91 ++++++++++++++----------------------------
> >   fs/9p/vfs_inode.c      | 45 +++++++--------------
> >   fs/9p/vfs_inode_dotl.c | 48 +++++++++-------------
> >   fs/9p/vfs_super.c      | 33 ++++-----------
> >   8 files changed, 135 insertions(+), 186 deletions(-)
> >
>
> Hi,
>
> this patch has already reached -next, but there is some spurious code.
>
> As, I'm not sure what the real intent is, I prefer to reply here instead
> of sending a patch.
>
>
> [...]
>
> > @@ -817,9 +814,14 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
> >
> >       v9ses = v9fs_inode2v9ses(dir);
> >       perm = unixmode2p9mode(v9ses, mode);
> > -     fid = v9fs_create(v9ses, dir, dentry, NULL, perm,
> > -                             v9fs_uflags2omode(flags,
> > -                                             v9fs_proto_dotu(v9ses)));
> > +     p9_omode = v9fs_uflags2omode(flags, v9fs_proto_dotu(v9ses));
> > +
> > +     if ((v9ses->cache >= CACHE_WRITEBACK) && (p9_omode & P9_OWRITE)) {
> > +             p9_omode = (p9_omode & !P9_OWRITE) | P9_ORDWR;
>
> This code looks strange.
> P9_OWRITE is 0x01, so !P9_OWRITE is 0.
> So the code is equivalent to "p9_omode = P9_ORDWR;"
>
> Is it what is expexted?
>
> Maybe
>         p9_omode = (p9_omode & ~P9_OWRITE) | P9_ORDWR;
> ?
>
> > +             p9_debug(P9_DEBUG_CACHE,
> > +                     "write-only file with writeback enabled, creating w/ O_RDWR\n");
> > +     }
> > +     fid = v9fs_create(v9ses, dir, dentry, NULL, perm, p9_omode);
> >       if (IS_ERR(fid)) {
> >               err = PTR_ERR(fid);
> >               goto error;
>
> [...]
>
> > diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
> > index a28eb3aeab29..4b9488cb7a56 100644
> > --- a/fs/9p/vfs_inode_dotl.c
> > +++ b/fs/9p/vfs_inode_dotl.c
> > @@ -232,12 +232,12 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
> >       int err = 0;
> >       kgid_t gid;
> >       umode_t mode;
> > +     int p9_omode = v9fs_open_to_dotl_flags(flags);
> >       const unsigned char *name = NULL;
> >       struct p9_qid qid;
> >       struct inode *inode;
> >       struct p9_fid *fid = NULL;
> > -     struct v9fs_inode *v9inode;
> > -     struct p9_fid *dfid = NULL, *ofid = NULL, *inode_fid = NULL;
> > +     struct p9_fid *dfid = NULL, *ofid = NULL;
> >       struct v9fs_session_info *v9ses;
> >       struct posix_acl *pacl = NULL, *dacl = NULL;
> >       struct dentry *res = NULL;
> > @@ -282,14 +282,19 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
> >       /* Update mode based on ACL value */
> >       err = v9fs_acl_mode(dir, &mode, &dacl, &pacl);
> >       if (err) {
> > -             p9_debug(P9_DEBUG_VFS, "Failed to get acl values in creat %d\n",
> > +             p9_debug(P9_DEBUG_VFS, "Failed to get acl values in create %d\n",
> >                        err);
> >               goto out;
> >       }
> > -     err = p9_client_create_dotl(ofid, name, v9fs_open_to_dotl_flags(flags),
> > -                                 mode, gid, &qid);
> > +
> > +     if ((v9ses->cache >= CACHE_WRITEBACK) && (p9_omode & P9_OWRITE)) {
> > +             p9_omode = (p9_omode & !P9_OWRITE) | P9_ORDWR;
>
> Same here.
>
> CJ
>
> > +             p9_debug(P9_DEBUG_CACHE,
> > +                     "write-only file with writeback enabled, creating w/ O_RDWR\n");
> > +     }
> > +     err = p9_client_create_dotl(ofid, name, p9_omode, mode, gid, &qid);
> >       if (err < 0) {
> > -             p9_debug(P9_DEBUG_VFS, "p9_client_open_dotl failed in creat %d\n",
> > +             p9_debug(P9_DEBUG_VFS, "p9_client_open_dotl failed in create %d\n",
> >                        err);
> >               goto out;
> >       }
>

  parent reply	other threads:[~2023-04-26  0:01 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20221217183142.1425132-1-evanhensbergen@icloud.com>
2022-12-18 23:22 ` [PATCH v2 00/10] Performance fixes for 9p filesystem Eric Van Hensbergen
2022-12-18 23:22   ` [PATCH v2 01/10] Adjust maximum MSIZE to account for p9 header Eric Van Hensbergen
2022-12-18 23:22   ` [PATCH v2 02/10] Expand setup of writeback cache to all levels Eric Van Hensbergen
2022-12-18 23:22   ` [PATCH v2 03/10] Consolidate file operations and add readahead and writeback Eric Van Hensbergen
2023-01-24  2:43     ` asmadeus
2023-01-24  3:03       ` Eric Van Hensbergen
2022-12-18 23:22   ` [PATCH v2 04/10] Remove unnecessary superblock flags Eric Van Hensbergen
2022-12-18 23:22   ` [PATCH v2 05/10] allow disable of xattr support on mount Eric Van Hensbergen
2022-12-18 23:22   ` [PATCH v2 06/10] fix bug in client create for .L Eric Van Hensbergen
2022-12-18 23:22   ` [PATCH v2 07/10] Add additional debug flags and open modes Eric Van Hensbergen
2022-12-18 23:22   ` [PATCH v2 08/10] Add new mount modes Eric Van Hensbergen
2023-01-24  3:35     ` Amir Goldstein
2022-12-18 23:22   ` [PATCH v2 09/10] fix error reporting in v9fs_dir_release Eric Van Hensbergen
2022-12-18 23:22   ` [PATCH v2 10/10] writeback mode fixes Eric Van Hensbergen
2023-01-23 16:31   ` [PATCH v2 00/10] Performance fixes for 9p filesystem Christian Schoenebeck
2023-01-24  2:33     ` evanhensbergen
2023-01-24  2:49       ` asmadeus
2023-01-24  2:38   ` [PATCH v3 00/11] " Eric Van Hensbergen
2023-01-24  2:38     ` [PATCH v3 01/11] Adjust maximum MSIZE to account for p9 header Eric Van Hensbergen
2023-01-24  2:38     ` [PATCH v3 02/11] Expand setup of writeback cache to all levels Eric Van Hensbergen
2023-01-24  2:38     ` [PATCH v3 03/11] Consolidate file operations and add readahead and writeback Eric Van Hensbergen
2023-01-24  2:38     ` [PATCH v3 04/11] Remove unnecessary superblock flags Eric Van Hensbergen
2023-01-24  2:38     ` [PATCH v3 05/11] allow disable of xattr support on mount Eric Van Hensbergen
2023-01-24  2:38     ` [PATCH v3 06/11] fix bug in client create for .L Eric Van Hensbergen
2023-01-24  2:38     ` [PATCH v3 07/11] Add additional debug flags and open modes Eric Van Hensbergen
2023-01-24  2:38     ` [PATCH v3 08/11] Add new mount modes Eric Van Hensbergen
2023-01-24  2:38     ` [PATCH v3 09/11] fix error reporting in v9fs_dir_release Eric Van Hensbergen
2023-01-24  2:38     ` [PATCH v3 10/11] writeback mode fixes Eric Van Hensbergen
2023-01-24  2:38     ` [PATCH v3 11/11] Fix revalidate Eric Van Hensbergen
2023-02-02 11:27     ` [PATCH v3 00/11] Performance fixes for 9p filesystem Christian Schoenebeck
2023-02-03 19:12       ` Eric Van Hensbergen
2023-02-04 13:40         ` Christian Schoenebeck
2023-02-04 21:38           ` Eric Van Hensbergen
2023-02-05 16:37       ` Eric Van Hensbergen
2023-02-06 13:20         ` Christian Schoenebeck
2023-02-06 13:37           ` Eric Van Hensbergen
2023-02-18  0:33     ` [PATCH v4 " Eric Van Hensbergen
2023-02-18  0:33       ` [PATCH v4 01/11] net/9p: Adjust maximum MSIZE to account for p9 header Eric Van Hensbergen
2023-02-18  7:50         ` asmadeus
2023-02-18  0:33       ` [PATCH v4 02/11] fs/9p: Expand setup of writeback cache to all levels Eric Van Hensbergen
2023-02-18  8:57         ` asmadeus
2023-02-18  0:33       ` [PATCH v4 03/11] fs/9p: Consolidate file operations and add readahead and writeback Eric Van Hensbergen
2023-02-18  9:24         ` asmadeus
2023-02-18 16:17           ` Eric Van Hensbergen
2023-02-18 16:19             ` Eric Van Hensbergen
2023-02-18 20:35               ` asmadeus
2023-02-27  2:50                 ` [PATCH v5 3/11] " Eric Van Hensbergen
2023-02-18  0:33       ` [PATCH v4 04/11] fs/9p: Remove unnecessary superblock flags Eric Van Hensbergen
2023-02-18  9:33         ` asmadeus
2023-02-18 16:24           ` Eric Van Hensbergen
2023-02-18 20:30             ` asmadeus
2023-02-18  0:33       ` [PATCH v4 05/11] fs/9p: allow disable of xattr support on mount Eric Van Hensbergen
2023-02-18  7:52         ` asmadeus
2023-02-18  0:33       ` [PATCH v4 06/11] net/9p: fix bug in client create for .L Eric Van Hensbergen
2023-02-18  8:01         ` asmadeus
2023-02-18  0:33       ` [PATCH v4 07/11] 9p: Add additional debug flags and open modes Eric Van Hensbergen
2023-02-18  8:05         ` asmadeus
2023-02-27  2:53           ` [PATCH v5 7/11] " Eric Van Hensbergen
2023-02-18  0:33       ` [PATCH v4 08/11] fs/9p: Add new mount modes Eric Van Hensbergen
2023-02-18  8:46         ` asmadeus
2023-02-27  2:55           ` [PATCH v5 8/11] " Eric Van Hensbergen
2023-02-18  0:33       ` [PATCH v4 09/11] fs/9p: fix error reporting in v9fs_dir_release Eric Van Hensbergen
2023-02-18  8:49         ` asmadeus
2023-02-18  0:33       ` [PATCH v4 10/11] fs/9p: writeback mode fixes Eric Van Hensbergen
2023-02-18  8:38         ` asmadeus
2023-02-18 10:01         ` asmadeus
2023-02-18 12:15           ` asmadeus
2023-02-18 16:40             ` Eric Van Hensbergen
2023-02-18 20:29               ` asmadeus
2023-03-21  1:12             ` Eric Van Hensbergen
2023-02-18 19:58           ` Christian Schoenebeck
2023-02-18 22:24             ` Eric Van Hensbergen
2023-02-18 23:40               ` asmadeus
2023-02-18 23:52                 ` Eric Van Hensbergen
2023-03-27  2:59         ` [PATCH v5] fs/9p: remove writeback fid and fix per-file modes Eric Van Hensbergen
2023-04-25  7:11           ` Christophe JAILLET
2023-04-25 11:13             ` asmadeus
2023-04-26  0:01             ` Eric Van Hensbergen [this message]
2023-04-26 16:45               ` Eric Van Hensbergen
2023-02-18  0:33       ` [PATCH v4 11/11] fs/9p: Fix revalidate Eric Van Hensbergen
2023-02-18  8:55         ` asmadeus
2023-02-18  7:48       ` [PATCH v4 00/11] Performance fixes for 9p filesystem asmadeus
2023-02-19 21:36       ` Christian Schoenebeck
2023-02-20  1:13         ` Eric Van Hensbergen

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='CAFkjPT=-EvCf1HKT2-k73G4SVBwRDp=YtvfwhNAcjv6BzS4f9Q@mail.gmail.com' \
    --to=ericvh@kernel.org \
    --cc=asmadeus@codewreck.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux_oss@crudebyte.com \
    --cc=v9fs-developer@lists.sourceforge.net \
    /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.