mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chengguang Xu <cgxu519@mykernel.net>
To: "Dominique Martinet" <asmadeus@codewreck.org>
Cc: "ericvh" <ericvh@gmail.com>, "lucho" <lucho@ionkov.net>,
	"linux-fsdevel" <linux-fsdevel@vger.kernel.org>,
	"linux-kernel" <linux-kernel@vger.kernel.org>,
	"v9fs-developer" <v9fs-developer@lists.sourceforge.net>
Subject: Re: [V9fs-developer] [RFC PATCH] 9p: create writeback fid on shared mmap
Date: Mon, 07 Dec 2020 21:13:31 +0800	[thread overview]
Message-ID: <1763d55f12b.11abdd4431975.7848752990749710617@mykernel.net> (raw)
In-Reply-To: <20201207112410.GA26628@nautica>

 ---- 在 星期一, 2020-12-07 19:24:10 Dominique Martinet <asmadeus@codewreck.org> 撰写 ----
 > Chengguang Xu wrote on Mon, Dec 07, 2020:
 > >  > , VM_MAYWRITE is set anytime we have a shared map where file has
 > >  > been opened read-write, which seems to be what you want with regards to
 > >  > protecting from mprotect calls.
 > >  > 
 > >  > How about simply changing check from WRITE to MAYWRITE?
 > > 
 > > It would be fine and based on the code in do_mmap(), it  seems we even don't
 > > need extra check here.  The condition (vma->vm_flags & VM_SHARED) will be enough.
 > > Am I missing something?
 > 
 > VM_MAYWRITE is unset if the file hasn't been open for writing (in which
 > case the mapping can't be mprotect()ed to writable map), so checking it
 > is a bit more efficient.
 > 
 > Anyway I'd like to obsolete the writeback fid uses now that fids have a
 > refcount (this usecase can be a simple refcount increase), in which case
 > efficiency is less of a problem, but we're not there yet...
 > 
 > Please resend with MAYWRITE if you want authorship and I'll try to take
 > some time to test incl. the mprotect usecase.
 > 

Thanks for the review, I'll send revised version later.

Thanks,
Chengguang

      reply	other threads:[~2020-12-07 13:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-05 13:09 Chengguang Xu
2020-12-06  9:16 ` Dominique Martinet
2020-12-06 20:53   ` [V9fs-developer] " Dominique Martinet
2020-12-07  6:02     ` Chengguang Xu
2020-12-07 11:24       ` Dominique Martinet
2020-12-07 13:13         ` Chengguang Xu [this message]

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=1763d55f12b.11abdd4431975.7848752990749710617@mykernel.net \
    --to=cgxu519@mykernel.net \
    --cc=asmadeus@codewreck.org \
    --cc=ericvh@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucho@ionkov.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®