From: Matthew Wilcox <willy@infradead.org>
To: Martin Oliveira <martin.oliveira@eideticom.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linux-rdma@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Artemy Kovalyov <artemyko@nvidia.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
Logan Gunthorpe <logang@deltatee.com>,
Michael Guralnik <michaelgur@nvidia.com>,
Mike Marciniszyn <mike.marciniszyn@intel.com>,
Shiraz Saleem <shiraz.saleem@intel.com>,
Tejun Heo <tj@kernel.org>, John Hubbard <jhubbard@nvidia.com>,
Dan Williams <dan.j.williams@intel.com>,
David Sloan <david.sloan@eideticom.com>
Subject: Re: [PATCH v3 1/3] kernfs: remove page_mkwrite() from vm_operations_struct
Date: Thu, 4 Jul 2024 18:02:26 +0100 [thread overview]
Message-ID: <ZobVol_trCwtwjK4@casper.infradead.org> (raw)
In-Reply-To: <20240704163724.2462161-2-martin.oliveira@eideticom.com>
On Thu, Jul 04, 2024 at 10:37:22AM -0600, Martin Oliveira wrote:
> @@ -482,6 +459,8 @@ static int kernfs_fop_mmap(struct file *file, struct vm_area_struct *vma)
> if (vma->vm_ops && vma->vm_ops->close)
> goto out_put;
>
> + WARN_ON(vma->vm_ops && vma->vm_ops->page_mkwrite);
> +
> rc = 0;
> if (!of->mmapped) {
> of->mmapped = true;
Seems to me we should actually _handle_ that, not do something wrong.
eg:
if (vma->vm_ops) {
if (vma->vm_ops->close)
goto out_put;
if (WARN_ON(vma->vm_ops->page_mkwrite))
goto out_put;
}
or maybe this doesn't need to be a WARN at all? After all, there
isn't one for having a ->close method, so why is page_mkwrite special?
next prev parent reply other threads:[~2024-07-04 17:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-04 16:37 [PATCH v3 0/3] Enable P2PDMA in Userspace RDMA Martin Oliveira
2024-07-04 16:37 ` [PATCH v3 1/3] kernfs: remove page_mkwrite() from vm_operations_struct Martin Oliveira
2024-07-04 16:48 ` Greg Kroah-Hartman
2024-07-04 17:02 ` Matthew Wilcox [this message]
2024-07-04 20:43 ` Martin Oliveira
2024-07-05 7:20 ` Christoph Hellwig
2024-07-08 16:31 ` Martin Oliveira
2024-07-04 16:37 ` [PATCH v3 2/3] mm/gup: allow FOLL_LONGTERM & FOLL_PCI_P2PDMA Martin Oliveira
2024-07-04 16:37 ` [PATCH v3 3/3] RDMA/umem: add support for P2P RDMA Martin Oliveira
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=ZobVol_trCwtwjK4@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=artemyko@nvidia.com \
--cc=dan.j.williams@intel.com \
--cc=david.sloan@eideticom.com \
--cc=gregkh@linuxfoundation.org \
--cc=jgg@ziepe.ca \
--cc=jhubbard@nvidia.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-rdma@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=martin.oliveira@eideticom.com \
--cc=michaelgur@nvidia.com \
--cc=mike.marciniszyn@intel.com \
--cc=shiraz.saleem@intel.com \
--cc=tj@kernel.org \
/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