[PATCH v2 25/30] fuse: Maintain a list of busy elements

2019-05-15 Thread Vivek Goyal
This list will be used selecting fuse_dax_mapping to free when number of free mappings drops below a threshold. Signed-off-by: Vivek Goyal --- fs/fuse/file.c | 8 fs/fuse/fuse_i.h | 7 +++ fs/fuse/inode.c | 4 3 files changed, 19 insertions(+) diff --git a/fs/fuse/file.c b

[PATCH v2 12/30] dax: remove block device dependencies

2019-05-15 Thread Vivek Goyal
From: Stefan Hajnoczi Although struct dax_device itself is not tied to a block device, some DAX code assumes there is a block device. Make block devices optional by allowing bdev to be NULL in commonly used DAX APIs. When there is no block device: * Skip the partition offset calculation in

[PATCH v2 15/30] virtio: Implement get_shm_region for PCI transport

2019-05-15 Thread Vivek Goyal
From: Sebastien Boeuf On PCI the shm regions are found using capability entries; find a region by searching for the capability. Signed-off-by: Sebastien Boeuf Signed-off-by: Dr. David Alan Gilbert --- drivers/virtio/virtio_pci_modern.c | 108 +

[PATCH v2 18/30] virtio_fs, dax: Set up virtio_fs dax_device

2019-05-15 Thread Vivek Goyal
. Signed-off-by: Stefan Hajnoczi Signed-off-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal Signed-off-by: Sebastien Boeuf Signed-off-by: Liu Bo --- fs/fuse/fuse_i.h | 1 + fs/fuse/inode.c| 8 ++ fs/fuse/virtio_fs.c| 173

[PATCH v2 30/30] virtio-fs: Do not provide abort interface in fusectl

2019-05-15 Thread Vivek Goyal
virtio-fs does not support aborting requests which are being processed. That is requests which have been sent to fuse daemon on host. So do not provide "abort" interface for virtio-fs in fusectl. Signed-off-by: Vivek Goyal --- fs/fuse/control.c | 4 ++-- fs/fuse/fuse_i.h| 4 +++

[PATCH v2 07/30] fuse: export fuse_get_unique()

2019-05-15 Thread Vivek Goyal
From: Stefan Hajnoczi virtio-fs will need unique IDs for FORGET requests from outside fs/fuse/dev.c. Make the symbol visible. Signed-off-by: Stefan Hajnoczi --- fs/fuse/dev.c| 3 ++- fs/fuse/fuse_i.h | 5 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/fuse/dev.c

[PATCH v2 26/30] fuse: Add logic to free up a memory range

2019-05-15 Thread Vivek Goyal
y. Also, worker thread does a trylock() on inode lock. That means worker tread will not wait on this inode and move onto next memory range. Hence above sequence should be deadlock free. Signed-off-by: Vivek Goyal --- fs/fuse/file.c | 357 +-- fs/fuse

[PATCH v2 08/30] fuse: extract fuse_fill_super_common()

2019-05-15 Thread Vivek Goyal
From: Stefan Hajnoczi fuse_fill_super() includes code to process the fd= option and link the struct fuse_dev to the fd's struct file. In virtio-fs there is no file descriptor because /dev/fuse is not used. This patch extracts fuse_fill_super_common() so that both classic fuse and virtio-fs can

[PATCH v2 11/30] virtio_fs: add skeleton virtio_fs.ko module

2019-05-15 Thread Vivek Goyal
From: Stefan Hajnoczi Add a basic file system module for virtio-fs. Signed-off-by: Stefan Hajnoczi Signed-off-by: Vivek Goyal --- fs/fuse/Kconfig | 11 + fs/fuse/Makefile| 1 + fs/fuse/fuse_i.h| 13 + fs/fuse/inode.c | 15

[PATCH v2 00/30] [RFC] virtio-fs: shared file system for virtual machines

2019-05-15 Thread Vivek Goyal
fuse_conn->dax_dev field virtio_fs, dax: Set up virtio_fs dax_device fuse, dax: add DAX mmap support Vivek Goyal (15): fuse: Clear setuid bit even in cache=never path fuse: Export fuse_send_init_request() fuse: Separate fuse device allocation and installation in fuse_conn dax:

[PATCH v2 06/30] fuse: Export fuse_send_init_request()

2019-05-15 Thread Vivek Goyal
This will be used by virtio-fs to send init request to fuse server after initialization of virt queues. Signed-off-by: Vivek Goyal --- fs/fuse/dev.c| 1 + fs/fuse/fuse_i.h | 1 + fs/fuse/inode.c | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/fuse/dev.c b/fs/fuse

[PATCH v2 09/30] fuse: add fuse_iqueue_ops callbacks

2019-05-15 Thread Vivek Goyal
From: Stefan Hajnoczi The /dev/fuse device uses fiq->waitq and fasync to signal that requests are available. These mechanisms do not apply to virtio-fs. This patch introduces callbacks so alternative behavior can be used. Note that queue_interrupt() changes along these lines:

[PATCH v2 19/30] fuse: Keep a list of free dax memory ranges

2019-05-15 Thread Vivek Goyal
Divide the dax memory range into fixed size ranges (2MB for now) and put them in a list. This will track free ranges. Once an inode requires a free range, we will take one from here and put it in interval-tree of ranges assigned to inode. Signed-off-by: Vivek Goyal Signed-off-by: Peng Tao

[PATCH v2 23/30] fuse: Define dax address space operations

2019-05-15 Thread Vivek Goyal
This is done along the lines of ext4 and xfs. I primarily wanted ->writepages hook at this time so that I could call into dax_writeback_mapping_range(). This in turn will decide which pfns need to be written back. Signed-off-by: Vivek Goyal --- fs/fuse/file.c | 19 +++ 1 f

Re: [PATCH] overlayfs: ignore empty NFSv4 ACLs in ext4 upperdir

2019-05-03 Thread Vivek Goyal
On Fri, May 03, 2019 at 01:41:25PM -0400, Amir Goldstein wrote: > On Fri, May 3, 2019 at 1:31 PM J. Bruce Fields wrote: > > > > On Fri, May 03, 2019 at 01:26:01PM -0400, Amir Goldstein wrote: > > > On Fri, May 3, 2019 at 12:03 PM J. Bruce Fields > > > wrote: > > > > > > > > On Thu, May 02, 2019

Re: [PATCH] virtio-fs: fix multiple tag support

2019-03-19 Thread Vivek Goyal
On Sun, Mar 17, 2019 at 08:35:21AM +0800, Liu Bo wrote: > While doing memremap from pci_dev's system bus address to kernel virtual > address, we assign a wrong value to the %end of pgmap.res, which ends up > with a wrong resource size in the process of memremap, and that further > prevent the

Re: [PATCH 00/52] [RFC] virtio-fs: shared file system for virtual machines

2019-02-12 Thread Vivek Goyal
On Tue, Feb 12, 2019 at 09:26:48PM +0530, Aneesh Kumar K.V wrote: > Vivek Goyal writes: > > > Hi, > > > > Here are RFC patches for virtio-fs. Looking for feedback on this approach. > > > > These patches should apply on top of 4.20-rc5. We have also put

Re: [RFC PATCH 0/3] cgroup: fsio throttle controller

2019-01-28 Thread Vivek Goyal
On Mon, Jan 28, 2019 at 06:41:29PM +0100, Andrea Righi wrote: > Hi Vivek, > > sorry for the late reply. > > On Mon, Jan 21, 2019 at 04:47:15PM -0500, Vivek Goyal wrote: > > On Sat, Jan 19, 2019 at 11:08:27AM +0100, Andrea Righi wrote: > > > > [..] > >

Re: [RFC PATCH 0/3] cgroup: fsio throttle controller

2019-01-21 Thread Vivek Goyal
On Sat, Jan 19, 2019 at 11:08:27AM +0100, Andrea Righi wrote: [..] > Alright, let's skip the root cgroup for now. I think the point here is > if we want to provide sync() isolation among cgroups or not. > > According to the manpage: > >sync() causes all pending modifications to

Re: [PATCH 15/52] fuse: map virtio_fs DAX window BAR

2018-12-13 Thread Vivek Goyal
On Thu, Dec 13, 2018 at 03:40:52PM -0500, Vivek Goyal wrote: > On Thu, Dec 13, 2018 at 12:15:51PM -0800, Dan Williams wrote: > > On Thu, Dec 13, 2018 at 12:09 PM Dr. David Alan Gilbert > > wrote: > > > > > > * Dan Williams (dan.j.willi...@intel.com) wrote: > &

Re: [PATCH 15/52] fuse: map virtio_fs DAX window BAR

2018-12-13 Thread Vivek Goyal
On Thu, Dec 13, 2018 at 12:15:51PM -0800, Dan Williams wrote: > On Thu, Dec 13, 2018 at 12:09 PM Dr. David Alan Gilbert > wrote: > > > > * Dan Williams (dan.j.willi...@intel.com) wrote: > > > On Mon, Dec 10, 2018 at 9:22 AM Vivek Goyal wrote: > >

Re: overlayfs access checks on underlying layers

2018-12-13 Thread Vivek Goyal
On Thu, Dec 13, 2018 at 03:09:55PM -0500, Stephen Smalley wrote: > On 12/13/18 1:54 PM, Vivek Goyal wrote: > > On Thu, Dec 13, 2018 at 11:12:31AM -0500, Stephen Smalley wrote: > > > > [..] > > > > > > Can you elaborate a bit more on how this is le

Re: overlayfs access checks on underlying layers

2018-12-13 Thread Vivek Goyal
On Thu, Dec 13, 2018 at 11:12:31AM -0500, Stephen Smalley wrote: [..] > > > > Can you elaborate a bit more on how this is leaking data through overlay > > > > mount. If it is, then why accessing file on lower is not equivalent of > > > > leaking of data. > > > > > > In the container use case,

Re: overlayfs access checks on underlying layers

2018-12-13 Thread Vivek Goyal
On Wed, Dec 12, 2018 at 09:51:59AM -0500, Stephen Smalley wrote: > On 12/11/18 4:48 PM, Vivek Goyal wrote: > > On Thu, Dec 06, 2018 at 03:26:26PM -0500, Stephen Smalley wrote: > > > On 12/5/18 8:43 AM, Vivek Goyal wrote: > > > > On Tue, Dec 04, 2018 at 11:49:16A

Re: [PATCH 00/52] [RFC] virtio-fs: shared file system for virtual machines

2018-12-12 Thread Vivek Goyal
On Wed, Dec 12, 2018 at 06:07:40PM +0100, Piotr Jurkiewicz wrote: > Currently, virtio-9p cannot be used with overlayfs in order to obtain > Docker-like experience (but with separate kernel) because of file attributes > problems. I wrote an email about that to qemu-devel almost year ago, but it >

Re: [PATCH 00/52] [RFC] virtio-fs: shared file system for virtual machines

2018-12-12 Thread Vivek Goyal
On Wed, Dec 12, 2018 at 03:30:49PM -0500, Konrad Rzeszutek Wilk wrote: > On Mon, Dec 10, 2018 at 12:12:26PM -0500, Vivek Goyal wrote: > > Hi, > > > > Here are RFC patches for virtio-fs. Looking for feedback on this approach. > > > > These patches should apply on

Re: overlayfs access checks on underlying layers

2018-12-11 Thread Vivek Goyal
On Thu, Dec 06, 2018 at 03:26:26PM -0500, Stephen Smalley wrote: > On 12/5/18 8:43 AM, Vivek Goyal wrote: > > On Tue, Dec 04, 2018 at 11:49:16AM -0500, Stephen Smalley wrote: > > > On 12/4/18 11:17 AM, Vivek Goyal wrote: > > > > On Tue, Dec 04, 2018 at 11:05:46A

[PATCH 04/52] fuse: extract fuse_fill_super_common()

2018-12-10 Thread Vivek Goyal
From: Stefan Hajnoczi fuse_fill_super() includes code to process the fd= option and link the struct fuse_dev to the fd's struct file. In virtio-fs there is no file descriptor because /dev/fuse is not used. This patch extracts fuse_fill_super_common() so that both classic fuse and virtio-fs can

[PATCH 03/52] fuse: rely on mutex_unlock() barrier instead of fput()

2018-12-10 Thread Vivek Goyal
From: Stefan Hajnoczi fput() will be moved out of this function in a later patch, so we cannot rely on it as the memory barrier for ensuring file->private_data = fud is visible. Luckily there is a mutex_unlock() right before fput() which provides the same effect. Signed-off-by: Stefan Hajnoczi

[PATCH 10/52] fuse: export fuse_get_unique()

2018-12-10 Thread Vivek Goyal
From: Stefan Hajnoczi virtio-fs will need unique IDs for FORGET requests from outside fs/fuse/dev.c. Make the symbol visible. Signed-off-by: Stefan Hajnoczi --- fs/fuse/dev.c| 3 ++- fs/fuse/fuse_i.h | 5 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/fuse/dev.c

[PATCH 01/52] fuse: add skeleton virtio_fs.ko module

2018-12-10 Thread Vivek Goyal
From: Stefan Hajnoczi Add a basic file system module for virtio-fs. Signed-off-by: Stefan Hajnoczi --- fs/fuse/Kconfig | 10 ++ fs/fuse/Makefile| 1 + fs/fuse/virtio_fs.c | 33 + 3 files changed, 44 insertions(+) create mode 100644

[PATCH 06/52] fuse: export fuse_end_request()

2018-12-10 Thread Vivek Goyal
From: Stefan Hajnoczi virtio-fs will need to complete requests from outside fs/fuse/dev.c. Make the symbol visible. Signed-off-by: Stefan Hajnoczi --- fs/fuse/dev.c| 19 ++- fs/fuse/fuse_i.h | 5 + 2 files changed, 15 insertions(+), 9 deletions(-) diff --git

[PATCH 12/52] virtio_fs: Set up dax_device

2018-12-10 Thread Vivek Goyal
From: Stefan Hajnoczi Setup a dax device. Signed-off-by: Stefan Hajnoczi --- fs/fuse/virtio_fs.c | 68 + 1 file changed, 68 insertions(+) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index 225eb729656f..fd914f2c6209 100644 ---

[PATCH 00/52] [RFC] virtio-fs: shared file system for virtual machines

2018-12-10 Thread Vivek Goyal
irtio_fs DAX window BAR fuse: Implement basic DAX read/write support commands fuse: add DAX mmap support Vivek Goyal (22): virtio-fs: Retrieve shm capabilities for cache virtio-fs: Map cache using the values from the capabilities Limit number of pages returned by direct_access() fuse: Int

[PATCH 43/52] fuse: Take inode lock for dax inode truncation

2018-12-10 Thread Vivek Goyal
-by: Vivek Goyal --- fs/fuse/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index d0942ce0a6c3..cb28cf26a6e7 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -406,7 +406,7 @@ int fuse_open_common(struct inode *inode, struct file *file

[PATCH 11/52] fuse: implement FUSE_FORGET for virtio-fs

2018-12-10 Thread Vivek Goyal
From: Stefan Hajnoczi Sent single FUSE_FORGET requests on the hiprio queue. In the future it may be possible to do FUSE_BATCH_FORGET but that is tricky since virtio-fs gets called synchronously when forgets are queued. Signed-off-by: Stefan Hajnoczi --- fs/fuse/virtio_fs.c | 93

[PATCH 13/52] dax: remove block device dependencies

2018-12-10 Thread Vivek Goyal
From: Stefan Hajnoczi Although struct dax_device itself is not tied to a block device, some DAX code assumes there is a block device. Make block devices optional by allowing bdev to be NULL in commonly used DAX APIs. When there is no block device: * Skip the partition offset calculation in

[PATCH 25/52] Introduce interval tree basic data structures

2018-12-10 Thread Vivek Goyal
We want to use interval tree to keep track of per inode dax mappings. Introduce basic data structures. Signed-off-by: Vivek Goyal --- fs/fuse/fuse_i.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index fb49ca9d05ac..a24f31156b47 100644

[PATCH 27/52] fuse: Maintain a list of busy elements

2018-12-10 Thread Vivek Goyal
This list will be used selecting fuse_dax_mapping to free when number of free mappings drops below a threshold. Signed-off-by: Vivek Goyal --- fs/fuse/file.c | 8 fs/fuse/fuse_i.h | 7 +++ fs/fuse/inode.c | 4 3 files changed, 19 insertions(+) diff --git a/fs/fuse/file.c b

[PATCH 31/52] dax: Pass dax_dev to dax_writeback_mapping_range()

2018-12-10 Thread Vivek Goyal
Right now dax_writeback_mapping_range() is passed a bdev and dax_dev is searched from that bdev name. virtio-fs does not have a bdev. So pass in dax_dev also to dax_writeback_mapping_range(). If dax_dev is passed in, bdev is not used otherwise dax_dev is searched using bdev. Signed-off-by: Vivek

[PATCH 29/52] fuse: add DAX mmap support

2018-12-10 Thread Vivek Goyal
From: Stefan Hajnoczi Add DAX mmap() support. Signed-off-by: Stefan Hajnoczi --- fs/fuse/file.c | 58 +- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 41d773ba2c72..5230f2d84a14

[PATCH 28/52] Do fallocate() to grow file before mapping for file growing writes

2018-12-10 Thread Vivek Goyal
. Signed-off-by: Vivek Goyal --- fs/fuse/file.c | 71 +- 1 file changed, 55 insertions(+), 16 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 94ad76382a6f..41d773ba2c72 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -28,6

[PATCH 19/52] virito-fs: Make dax optional

2018-12-10 Thread Vivek Goyal
From: "Dr. David Alan Gilbert" Add a 'dax' option and only enable dax when it's on. Also show "dax" in mount options if filesystem was mounted with dax enabled. Signed-off-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal --- fs/fuse/fuse_i.h| 1 + fs/

[PATCH 22/52] Create a list of free memory ranges

2018-12-10 Thread Vivek Goyal
Divide the dax memory range into fixed size ranges (2MB for now) and put them in a list. This will track free ranges. Once an inode requires a free range, we will take one from here and put it in interval-tree of ranges assigned to inode. Signed-off-by: Vivek Goyal --- fs/fuse/fuse_i.h| 14

[PATCH 15/52] fuse: map virtio_fs DAX window BAR

2018-12-10 Thread Vivek Goyal
From: Stefan Hajnoczi Experimental QEMU code introduces an MMIO BAR for mapping portions of files in the virtio-fs device. Map this BAR so that FUSE DAX can access file contents from the host page cache. The DAX window is accessed by the fs/dax.c infrastructure and must have struct pages (at

[PATCH 09/52] fuse: process requests queues

2018-12-10 Thread Vivek Goyal
From: Stefan Hajnoczi Send normal requests to the device and handle completions. This is enough to get mount and basic I/O working. The hiprio and notifications queues still need to be implemented for full FUSE functionality. Signed-off-by: Stefan Hajnoczi --- fs/fuse/fuse_i.h| 3 +

[PATCH 36/52] fuse: Kick worker when free memory drops below 20% of total ranges

2018-12-10 Thread Vivek Goyal
Kick worker to free up some memory when number of free ranges drops below 20% of total free ranges at the time of initialization. Signed-off-by: Vivek Goyal --- fs/fuse/file.c | 11 ++- fs/fuse/fuse_i.h | 9 + fs/fuse/inode.c | 1 + 3 files changed, 20 insertions(+), 1

[PATCH 44/52] fuse: Clear setuid bit even in direct I/O path

2018-12-10 Thread Vivek Goyal
With cache=never, we fall back to direct IO. pjdfstest chmod test 12.t was failing because if a file has setuid bit, it should be cleared if an unpriviledged user opens it for write and writes to it. Call fuse_remove_privs() even for direct I/O path. Signed-off-by: Vivek Goyal --- fs/fuse

[PATCH 21/52] fuse: Introduce fuse_dax_mapping

2018-12-10 Thread Vivek Goyal
Introduce fuse_dax_mapping. This type will be used to keep track of per inode dax mappings. Signed-off-by: Vivek Goyal --- fs/fuse/fuse_i.h | 9 + 1 file changed, 9 insertions(+) diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 345abe9b022f..b9880be690bd 100644 --- a/fs/fuse

[PATCH 18/52] virtio-fs: Map cache using the values from the capabilities

2018-12-10 Thread Vivek Goyal
Instead of assuming we had the fixed bar for the cache, use the value from the capabilities. Signed-off-by: Dr. David Alan Gilbert --- fs/fuse/virtio_fs.c | 32 +--- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/fs/fuse/virtio_fs.c

[PATCH 26/52] fuse: Implement basic DAX read/write support commands

2018-12-10 Thread Vivek Goyal
From: Stefan Hajnoczi This patch implements basic DAX support. mmap() is not implemented yet and will come in later patches. This patch looks into implemeting read/write. Signed-off-by: Stefan Hajnoczi Signed-off-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal --- fs/fuse/file.c

[PATCH 35/52] fuse: Add logic to do direct reclaim of memory

2018-12-10 Thread Vivek Goyal
t path). Signed-off-by: Vivek Goyal --- fs/fuse/file.c | 121 + 1 file changed, 105 insertions(+), 16 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 17becdff3014..13db83d105ff 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@

[PATCH 20/52] Limit number of pages returned by direct_access()

2018-12-10 Thread Vivek Goyal
Truncate number of pages mapped by direct_access() to remain with-in window size. User might request mapping pages beyond window size. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse

[PATCH 40/52] fuse: Do not block on inode lock while freeing memory range

2018-12-10 Thread Vivek Goyal
. Signed-off-by: Vivek Goyal --- fs/fuse/file.c | 36 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index d86f6e5c4daf..dbe3410a94d7 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -3891,7 +3891,12 @@ int

[PATCH 38/52] Dispatch FORGET requests later instead of dropping them

2018-12-10 Thread Vivek Goyal
If virtio queue is full, then don't drop FORGET requests. Instead, wait a bit and try to dispatch these little later using a worker thread. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 86 - 1 file changed, 78 insertions(+), 8

[PATCH 45/52] virtio: Free fuse devices on umount

2018-12-10 Thread Vivek Goyal
From: "Dr. David Alan Gilbert" When unmounting the fs close all the fuse devices. This includes making sure the daemon gets a FUSE_DESTROY to tell it. Signed-off-by: Dr. David Alan Gilbert --- fs/fuse/fuse_i.h| 1 + fs/fuse/inode.c | 3 ++- fs/fuse/virtio_fs.c | 13 - 3

[PATCH 37/52] fuse: multiplex cached/direct_io/dax file operations

2018-12-10 Thread Vivek Goyal
From: Miklos Szeredi --- fs/fuse/file.c | 91 -- fs/splice.c| 3 +- include/linux/fs.h | 2 ++ 3 files changed, 52 insertions(+), 44 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 1f172d372eeb..6421c94cef46

[PATCH 39/52] Release file in process context

2018-12-10 Thread Vivek Goyal
g fuse replies from daemon on the host). That means it blocks worker thread and it stops processing further replies and system deadlocks. So for now, force sync release of file in case of DAX inodes. Signed-off-by: Vivek Goyal --- fs/fuse/file.c | 15 ++- 1 file changed, 14 insertions

[PATCH 50/52] fuse: add shared version support (virtio-fs only)

2018-12-10 Thread Vivek Goyal
From: Miklos Szeredi Metadata and dcache versioning support. READDIRPLUS doesn't supply version information yet, so don't use. Signed-off-by: Miklos Szeredi --- fs/fuse/dev.c | 3 +- fs/fuse/dir.c | 244 +++--- fs/fuse/file.c

[PATCH 14/52] fuse: add fuse_conn->dax_dev field

2018-12-10 Thread Vivek Goyal
From: Stefan Hajnoczi A struct dax_device instance is a prerequisite for the DAX filesystem APIs. Let virtio_fs associate a dax_device with a fuse_conn. Classic FUSE and CUSE set the pointer to NULL, disabling DAX. Signed-off-by: Stefan Hajnoczi --- fs/fuse/cuse.c | 3 ++-

[PATCH 52/52] fuse: fix fuse_permission() for the default_permissions case

2018-12-10 Thread Vivek Goyal
From: Miklos Szeredi Fixes: f064cab7f6ee ("fuse: add shared version support (virtio-fs only)") Signed-off-by: Miklos Szeredi --- fs/fuse/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index f9a91e782cf0..f1da787796e8 100644 ---

[PATCH 42/52] fuse: Wait for memory ranges to become free

2018-12-10 Thread Vivek Goyal
uld be deadlock free. Signed-off-by: Vivek Goyal --- fs/fuse/file.c | 60 +++- fs/fuse/fuse_i.h | 3 +++ fs/fuse/inode.c | 1 + 3 files changed, 50 insertions(+), 14 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 70974745833

[PATCH 47/52] virtio-fs: Map using the values from the capabilities

2018-12-10 Thread Vivek Goyal
From: "Dr. David Alan Gilbert" Instead of assuming we had the fixed bar for the cache, use the value from the capabilities. Use the other capabilities to map their memory. Signed-off-by: Dr. David Alan Gilbert --- fs/fuse/virtio_fs.c | 95 +

[PATCH 48/52] virtio-fs: pass version table pointer to fuse

2018-12-10 Thread Vivek Goyal
From: Miklos Szeredi Signed-off-by: Miklos Szeredi --- fs/fuse/fuse_i.h| 12 fs/fuse/inode.c | 10 ++ fs/fuse/virtio_fs.c | 2 ++ 3 files changed, 24 insertions(+) diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 30c7b4b56200..8a2604606d51 100644 ---

[PATCH 41/52] fuse: Reschedule dax free work if too many EAGAIN attempts

2018-12-10 Thread Vivek Goyal
the dax ranges, all the attempts to acquire lock will fail. So if there are too many inode lock failures (-EAGAIN), reschedule the worker with a 10ms delay. Signed-off-by: Vivek Goyal --- fs/fuse/file.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/fs/fuse

[PATCH 08/52] fuse: add fuse_iqueue_ops callbacks

2018-12-10 Thread Vivek Goyal
From: Stefan Hajnoczi The /dev/fuse device uses fiq->waitq and fasync to signal that requests are available. These mechanisms do not apply to virtio-fs. This patch introduces callbacks so alternative behavior can be used. Note that queue_interrupt() changes along these lines:

[PATCH 23/52] fuse: simplify fuse_fill_super_common() calling

2018-12-10 Thread Vivek Goyal
From: Miklos Szeredi Add more fields to "struct fuse_mount_data" so that less parameters have to be passed to function fuse_fill_super_common(). Signed-off-by: Miklos Szeredi --- fs/fuse/fuse_i.h| 22 +- fs/fuse/inode.c | 27 ++-

[PATCH 49/52] fuse: don't crash if version table is NULL

2018-12-10 Thread Vivek Goyal
From: Miklos Szeredi Version table can be NULL. Do not crash. Signed-off-by: Miklos Szeredi --- fs/fuse/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 1ab4df442390..d44827bbfa3d 100644 --- a/fs/fuse/inode.c +++

[PATCH 33/52] fuse, dax: Take ->i_mmap_sem lock during dax page fault

2018-12-10 Thread Vivek Goyal
about circular dependencies. So define a new fuse_inode->i_mmap_sem. Signed-off-by: Vivek Goyal --- fs/fuse/dir.c| 2 ++ fs/fuse/file.c | 17 + fs/fuse/fuse_i.h | 7 +++ fs/fuse/inode.c | 1 + 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/fs/fuse/di

[PATCH 07/52] fuse: export fuse_len_args()

2018-12-10 Thread Vivek Goyal
From: Stefan Hajnoczi virtio-fs will need to query the length of fuse_arg lists. Make the symbol visible. Signed-off-by: Stefan Hajnoczi --- fs/fuse/dev.c| 7 --- fs/fuse/fuse_i.h | 5 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c

[PATCH 46/52] virtio-fs: Retrieve shm capabilities for version table

2018-12-10 Thread Vivek Goyal
From: "Dr. David Alan Gilbert" Retrieve the capabilities needed to find the journal and version table. Signed-off-by: Dr. David Alan Gilbert --- fs/fuse/virtio_fs.c| 26 -- include/uapi/linux/virtio_fs.h | 2 ++ 2 files changed, 26 insertions(+), 2

[PATCH 16/52] virtio-fs: Add VIRTIO_PCI_CAP_SHARED_MEMORY_CFG and utility to find them

2018-12-10 Thread Vivek Goyal
From: "Dr. David Alan Gilbert" The shm cap defines a capability to allow 64bit size chunks at 64 bit size offsets into a bar. There can be multiple such chunks on any one device. Signed-off-by: Dr. David Alan Gilbert --- fs/fuse/virtio_fs.c | 69

[PATCH 17/52] virtio-fs: Retrieve shm capabilities for cache

2018-12-10 Thread Vivek Goyal
Retrieve the capabilities needed to find the cache. Signed-off-by: Dr. David Alan Gilbert --- fs/fuse/virtio_fs.c| 15 +++ include/uapi/linux/virtio_fs.h | 3 +++ 2 files changed, 18 insertions(+) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index

[PATCH 24/52] fuse: Introduce setupmapping/removemapping commands

2018-12-10 Thread Vivek Goyal
Introduce two new fuse commands to setup/remove memory mappings. Signed-off-by: Vivek Goyal --- include/uapi/linux/fuse.h | 33 + 1 file changed, 33 insertions(+) diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h index b4967d48bfda..867fdafc4a5e

[PATCH 51/52] fuse: shared version cleanups

2018-12-10 Thread Vivek Goyal
From: Miklos Szeredi Signed-off-by: Miklos Szeredi --- fs/fuse/dir.c | 40 +--- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 3aa214f9a28e..f9a91e782cf0 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@

[PATCH 30/52] fuse: delete dentry if timeout is zero

2018-12-10 Thread Vivek Goyal
From: Miklos Szeredi Don't hold onto dentry in lru list if need to re-lookup it anyway at next access. More advanced version of this patch would periodically flush out dentries from the lru which have gone stale. Signed-off-by: Miklos Szeredi --- fs/fuse/dir.c | 26 +++---

[PATCH 32/52] fuse: Define dax address space operations

2018-12-10 Thread Vivek Goyal
This is done along the lines of ext4 and xfs. I primarily wanted ->writepages hook at this time so that I could call into dax_writeback_mapping_range(). This in turn will decide which pfns need to be written back and call dax_flush() on those. Signed-off-by: Vivek Goyal --- fs/fuse/file.c |

[PATCH 05/52] virtio_fs: get mount working

2018-12-10 Thread Vivek Goyal
From: Stefan Hajnoczi Provide definitions of ->mount and ->kill_sb. This is still WIP. Signed-off-by: Stefan Hajnoczi --- fs/fuse/fuse_i.h| 9 fs/fuse/inode.c | 12 - fs/fuse/virtio_fs.c | 129 +++- 3 files changed, 146

[PATCH 34/52] fuse: Add logic to free up a memory range

2018-12-10 Thread Vivek Goyal
Add logic to free up a busy memory range. Freed memory range will be returned to free pool. Add a worker which can be started to select and free some busy memory ranges. Signed-off-by: Vivek Goyal --- fs/fuse/file.c | 148 ++- fs/fuse

[PATCH 02/52] fuse: add probe/remove virtio driver

2018-12-10 Thread Vivek Goyal
From: Stefan Hajnoczi Add basic probe/remove functionality for the new virtio-fs device. Signed-off-by: Stefan Hajnoczi --- fs/fuse/Kconfig | 1 + fs/fuse/virtio_fs.c | 160 ++-- include/uapi/linux/virtio_fs.h | 41 ++

Re: overlayfs access checks on underlying layers

2018-12-05 Thread Vivek Goyal
On Tue, Dec 04, 2018 at 11:49:16AM -0500, Stephen Smalley wrote: > On 12/4/18 11:17 AM, Vivek Goyal wrote: > > On Tue, Dec 04, 2018 at 11:05:46AM -0500, Stephen Smalley wrote: > > > On 12/4/18 10:42 AM, Vivek Goyal wrote: > > > > On Tue, Dec 04, 2018 at 04:31:09

Re: overlayfs access checks on underlying layers

2018-12-05 Thread Vivek Goyal
On Tue, Dec 04, 2018 at 11:49:16AM -0500, Stephen Smalley wrote: > On 12/4/18 11:17 AM, Vivek Goyal wrote: > > On Tue, Dec 04, 2018 at 11:05:46AM -0500, Stephen Smalley wrote: > > > On 12/4/18 10:42 AM, Vivek Goyal wrote: > > > > On Tue, Dec 04, 2018 at 04:31:09

Re: overlayfs access checks on underlying layers

2018-12-04 Thread Vivek Goyal
On Tue, Dec 04, 2018 at 11:05:46AM -0500, Stephen Smalley wrote: > On 12/4/18 10:42 AM, Vivek Goyal wrote: > > On Tue, Dec 04, 2018 at 04:31:09PM +0100, Miklos Szeredi wrote: > > > On Tue, Dec 4, 2018 at 4:22 PM Vivek Goyal wrote: > > > > > > > Having said

Re: overlayfs access checks on underlying layers

2018-12-04 Thread Vivek Goyal
On Tue, Dec 04, 2018 at 11:05:46AM -0500, Stephen Smalley wrote: > On 12/4/18 10:42 AM, Vivek Goyal wrote: > > On Tue, Dec 04, 2018 at 04:31:09PM +0100, Miklos Szeredi wrote: > > > On Tue, Dec 4, 2018 at 4:22 PM Vivek Goyal wrote: > > > > > > > Having said

Re: overlayfs access checks on underlying layers

2018-12-04 Thread Vivek Goyal
On Tue, Dec 04, 2018 at 10:42:35AM -0500, Stephen Smalley wrote: [..] > > > Yes, in that case there isn't an escalation of privilege for the mounter > > > (I > > > acknowledged that above). I'm still not sure copy-up of special files is > > > a > > > good idea though: > > > > > > - In the

Re: overlayfs access checks on underlying layers

2018-12-04 Thread Vivek Goyal
On Tue, Dec 04, 2018 at 10:42:35AM -0500, Stephen Smalley wrote: [..] > > > Yes, in that case there isn't an escalation of privilege for the mounter > > > (I > > > acknowledged that above). I'm still not sure copy-up of special files is > > > a > > > good idea though: > > > > > > - In the

Re: overlayfs access checks on underlying layers

2018-12-04 Thread Vivek Goyal
On Tue, Dec 04, 2018 at 04:31:09PM +0100, Miklos Szeredi wrote: > On Tue, Dec 4, 2018 at 4:22 PM Vivek Goyal wrote: > > > Having said that, this still create little anomaly when mknod to client > > is not allowed on context label. So a device file, which is on lower > >

Re: overlayfs access checks on underlying layers

2018-12-04 Thread Vivek Goyal
On Tue, Dec 04, 2018 at 04:31:09PM +0100, Miklos Szeredi wrote: > On Tue, Dec 4, 2018 at 4:22 PM Vivek Goyal wrote: > > > Having said that, this still create little anomaly when mknod to client > > is not allowed on context label. So a device file, which is on lower > >

Re: overlayfs access checks on underlying layers

2018-12-04 Thread Vivek Goyal
On Tue, Dec 04, 2018 at 10:15:49AM -0500, Vivek Goyal wrote: > On Tue, Dec 04, 2018 at 09:30:53AM -0500, Stephen Smalley wrote: > > On 12/4/18 8:32 AM, Miklos Szeredi wrote: > > > On Thu, Nov 29, 2018 at 10:16 PM Stephen Smalley > > > wrote: > > > > >

Re: overlayfs access checks on underlying layers

2018-12-04 Thread Vivek Goyal
On Tue, Dec 04, 2018 at 10:15:49AM -0500, Vivek Goyal wrote: > On Tue, Dec 04, 2018 at 09:30:53AM -0500, Stephen Smalley wrote: > > On 12/4/18 8:32 AM, Miklos Szeredi wrote: > > > On Thu, Nov 29, 2018 at 10:16 PM Stephen Smalley > > > wrote: > > > > >

Re: overlayfs access checks on underlying layers

2018-12-04 Thread Vivek Goyal
On Tue, Dec 04, 2018 at 09:30:53AM -0500, Stephen Smalley wrote: > On 12/4/18 8:32 AM, Miklos Szeredi wrote: > > On Thu, Nov 29, 2018 at 10:16 PM Stephen Smalley wrote: > > > > > > On 11/29/18 4:03 PM, Stephen Smalley wrote: > > > > On 11/29/18 2:47 PM, Miklos Szeredi wrote: > > > > > On Thu,

Re: overlayfs access checks on underlying layers

2018-12-04 Thread Vivek Goyal
On Tue, Dec 04, 2018 at 09:30:53AM -0500, Stephen Smalley wrote: > On 12/4/18 8:32 AM, Miklos Szeredi wrote: > > On Thu, Nov 29, 2018 at 10:16 PM Stephen Smalley wrote: > > > > > > On 11/29/18 4:03 PM, Stephen Smalley wrote: > > > > On 11/29/18 2:47 PM, Miklos Szeredi wrote: > > > > > On Thu,

Re: overlayfs access checks on underlying layers

2018-11-29 Thread Vivek Goyal
On Thu, Nov 29, 2018 at 12:04:20PM +0100, Miklos Szeredi wrote: > On Wed, Nov 28, 2018 at 10:43 PM Stephen Smalley wrote: > > > > On 11/28/18 3:24 PM, Miklos Szeredi wrote: > > > On Wed, Nov 28, 2018 at 8:32 PM Stephen Smalley > > > wrote: > > [...] > > > >> Does the breaking commit

Re: overlayfs access checks on underlying layers

2018-11-29 Thread Vivek Goyal
On Thu, Nov 29, 2018 at 12:04:20PM +0100, Miklos Szeredi wrote: > On Wed, Nov 28, 2018 at 10:43 PM Stephen Smalley wrote: > > > > On 11/28/18 3:24 PM, Miklos Szeredi wrote: > > > On Wed, Nov 28, 2018 at 8:32 PM Stephen Smalley > > > wrote: > > [...] > > > >> Does the breaking commit

Re: overlayfs access checks on underlying layers

2018-11-28 Thread Vivek Goyal
On Wed, Nov 28, 2018 at 11:00:09AM +0100, Miklos Szeredi wrote: > On Tue, Nov 27, 2018 at 10:05 PM Vivek Goyal wrote: > > > > On Tue, Nov 27, 2018 at 08:58:06PM +0100, Miklos Szeredi wrote: > > > [resending with fixed email address for Paul Moore] > > > >

Re: overlayfs access checks on underlying layers

2018-11-28 Thread Vivek Goyal
On Wed, Nov 28, 2018 at 11:00:09AM +0100, Miklos Szeredi wrote: > On Tue, Nov 27, 2018 at 10:05 PM Vivek Goyal wrote: > > > > On Tue, Nov 27, 2018 at 08:58:06PM +0100, Miklos Szeredi wrote: > > > [resending with fixed email address for Paul Moore] > > > >

Re: overlayfs access checks on underlying layers

2018-11-27 Thread Vivek Goyal
On Tue, Nov 27, 2018 at 08:58:06PM +0100, Miklos Szeredi wrote: > [resending with fixed email address for Paul Moore] > > Moving discussion from github[1] to here. > > To summarize: commit 007ea44892e6 ("ovl: relax permission checking on > underlying layers") was added in 4.20-rc1 to make

Re: overlayfs access checks on underlying layers

2018-11-27 Thread Vivek Goyal
On Tue, Nov 27, 2018 at 08:58:06PM +0100, Miklos Szeredi wrote: > [resending with fixed email address for Paul Moore] > > Moving discussion from github[1] to here. > > To summarize: commit 007ea44892e6 ("ovl: relax permission checking on > underlying layers") was added in 4.20-rc1 to make

Re: [PATCH v8 2/2] overlayfs: override_creds=off option bypass creator_cred

2018-11-08 Thread Vivek Goyal
e the content have a different set of MAC > privileges (eg: read, for vendor labelled configuration, execute for > vendor libraries and modules). > > Signed-off-by: Mark Salyzyn > Cc: Miklos Szeredi > Cc: Jonathan Corbet > Cc: Vivek Goyal > Cc: Eric W. Biederman > C

Re: [PATCH v8 2/2] overlayfs: override_creds=off option bypass creator_cred

2018-11-08 Thread Vivek Goyal
e the content have a different set of MAC > privileges (eg: read, for vendor labelled configuration, execute for > vendor libraries and modules). > > Signed-off-by: Mark Salyzyn > Cc: Miklos Szeredi > Cc: Jonathan Corbet > Cc: Vivek Goyal > Cc: Eric W. Biederman > C

<    1   2   3   4   5   6   7   8   9   10   >