[PATCH] fuse: relax inode_lock on fsync(2)

2016-12-13 Thread Maxim Patlasov
Sometimes handling FUSE_FSYNC in userspace may take a while. No need to block incoming writes while userspace processes FUSE_FSYNC. Signed-off-by: Maxim Patlasov --- fs/fuse/file.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 2401c5d..9d52a8a

[PATCH v2] btrfs: limit async_work allocation and worker func duration

2016-12-12 Thread Maxim Patlasov
ms in straightforward way: refuse queuing too many works in btrfs_wq_run_delayed_node and bail out of worker func if at least BTRFS_DELAYED_WRITEBACK items are processed. Changed in v2: remove support of thresh == NO_THRESHOLD. Signed-off-by: Maxim Patlasov --- fs/btrfs/async-thread.c | 14 ++

Re: [PATCH] btrfs: limit async_work allocation and worker func duration

2016-12-12 Thread Maxim Patlasov
On 12/12/2016 06:54 AM, David Sterba wrote: On Fri, Dec 02, 2016 at 05:51:36PM -0800, Maxim Patlasov wrote: Problem statement: unprivileged user who has read-write access to more than one btrfs subvolume may easily consume all kernel memory (eventually triggering oom-killer). Reproducer

[PATCH] btrfs: limit async_work allocation and worker func duration

2016-12-02 Thread Maxim Patlasov
ms in straightforward way: refuse queuing too many works in btrfs_wq_run_delayed_node and bail out of worker func if at least BTRFS_DELAYED_WRITEBACK items are processed. Signed-off-by: Maxim Patlasov --- fs/btrfs/async-thread.c |8 fs/btrfs/async-thread.h |1 + fs/btrfs/delay

Re: [fuse-devel] fuse: max_background and congestion_threshold settings

2016-11-22 Thread Maxim Patlasov
On 11/22/2016 02:45 PM, Nikolaus Rath wrote: On Nov 16 2016, Maxim Patlasov wrote: On 11/16/2016 12:19 PM, Nikolaus Rath wrote: On Nov 16 2016, Maxim Patlasov wrote: On 11/16/2016 11:19 AM, Nikolaus Rath wrote: Hi Maxim, On Nov 15 2016, Maxim Patlasov wrote: On 11/15/2016 08:18 AM

Re: [fuse-devel] fuse: max_background and congestion_threshold settings

2016-11-16 Thread Maxim Patlasov
On 11/16/2016 11:19 AM, Nikolaus Rath wrote: Hi Maxim, On Nov 15 2016, Maxim Patlasov wrote: On 11/15/2016 08:18 AM, Nikolaus Rath wrote: Could someone explain to me the meaning of the max_background and congestion_threshold settings of the fuse module? At first I assumed that

Re: [fuse-devel] fuse: max_background and congestion_threshold settings

2016-11-16 Thread Maxim Patlasov
On 11/16/2016 12:19 PM, Nikolaus Rath wrote: On Nov 16 2016, Maxim Patlasov wrote: On 11/16/2016 11:19 AM, Nikolaus Rath wrote: Hi Maxim, On Nov 15 2016, Maxim Patlasov wrote: On 11/15/2016 08:18 AM, Nikolaus Rath wrote: Could someone explain to me the meaning of the max_background and

Re: [fuse-devel] fuse: max_background and congestion_threshold settings

2016-11-16 Thread Maxim Patlasov
Hi, On 11/15/2016 08:18 AM, Nikolaus Rath wrote: Hello, Could someone explain to me the meaning of the max_background and congestion_threshold settings of the fuse module? At first I assumed that max_background specifies the maximum number of pending requests (i.e., requests that have been se

[PATCH v2] fuse: fuse_flush must check mapping->flags for errors

2016-07-20 Thread Maxim Patlasov
silly type: check must be *after* fuse_sync_writes() Signed-off-by: Maxim Patlasov --- fs/fuse/file.c |9 + 1 file changed, 9 insertions(+) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index ad1da83..6cac3dc 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -417,6 +417,15 @@ stat

[PATCH] fuse: fuse_flush must check mapping->flags for errors

2016-07-19 Thread Maxim Patlasov
fuse_flush() calls write_inode_now() that triggers writeback, but actual writeback will happen later, on fuse_sync_writes(). If an error happens, fuse_writepage_end() will set error bit in mapping->flags. So, we have to check mapping->flags after fuse_sync_writes(). Signed-off-by: Maxim Pa

[PATCH] fuse: fsync() did not return IO errors

2016-07-19 Thread Maxim Patlasov
From: Alexey Kuznetsov Due to implementation of fuse writeback filemap_write_and_wait_range() does not catch errors. We have to do this directly after fuse_sync_writes() Signed-off-by: Alexey Kuznetsov Signed-off-by: Maxim Patlasov --- fs/fuse/file.c | 15 +++ 1 file changed

[PATCH] tmpfs: shmem_fallocate must return ERESTARTSYS

2016-03-03 Thread Maxim Patlasov
shmem_fallocate() is restartable, so it can return ERESTARTSYS if signal_pending(). Although fallocate(2) manpage permits EINTR, the more places use ERESTARTSYS the better. Signed-off-by: Maxim Patlasov --- mm/shmem.c |8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git

Re: [PATCH] fs/pnode.c: treat zero mnt_group_id-s as unequal

2016-02-16 Thread Maxim Patlasov
On 02/16/2016 11:54 AM, Al Viro wrote: On Tue, Feb 16, 2016 at 11:45:33AM -0800, Maxim Patlasov wrote: propagate_one(m) calculates "type" argument for copy_tree() like this: if (m->mnt_group_id == last_dest->mnt_group_id) { type = CL_MAKE_SHARED; } els

[PATCH] fs/pnode.c: treat zero mnt_group_id-s as unequal

2016-02-16 Thread Maxim Patlasov
; clause above when we have to ascend upward in the master/slave tree by calling: >last_source = last_source->mnt_master; >last_dest = last_source->mnt_parent; proper number of times. The last step is governed by "n->mnt_group_id != last_dest->mnt_group_id" condition that

Re: [PATCH] kvm: do not SetPageDirty from kvm_set_pfn_dirty for file mappings

2016-02-12 Thread Maxim Patlasov
On 02/12/2016 05:48 AM, Dmitry Monakhov wrote: Maxim Patlasov writes: The patch solves the following problem: file system specific routines involved in ordinary routine writeback process BUG_ON page_buffers() because a page goes to writeback without buffer-heads attached. The way how

[PATCH] kvm: do not SetPageDirty from kvm_set_pfn_dirty for file mappings

2016-02-11 Thread Maxim Patlasov
from kvm_set_pfn_dirty redundant. Signed-off-by: Maxim Patlasov --- virt/kvm/kvm_main.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index a11cfd2..5a7d3fa 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -

Re: [fuse-devel] [PATCH] fuse: break infinite loop in fuse_fill_write_pages()

2015-10-05 Thread Maxim Patlasov
On 10/02/2015 06:58 PM, Konstantin Khlebnikov wrote: On Sat, Oct 3, 2015 at 1:04 AM, Andrew Morton wrote: On Fri, 2 Oct 2015 12:27:45 -0700 Maxim Patlasov wrote: On 10/02/2015 04:21 AM, Konstantin Khlebnikov wrote: Bump. Add more peopple in CC. On Mon, Sep 21, 2015 at 1:02 PM, Roman

Re: [fuse-devel] [PATCH] fuse: break infinite loop in fuse_fill_write_pages()

2015-10-02 Thread Maxim Patlasov
On 10/02/2015 04:21 AM, Konstantin Khlebnikov wrote: Bump. Add more peopple in CC. On Mon, Sep 21, 2015 at 1:02 PM, Roman Gushchin wrote: I got a report about unkillable task eating CPU. Thge further investigation shows, that the problem is in the fuse_fill_write_pages() function. If iov's fir

Re: [PATCH v2 4/4] block: loop: support to submit I/O via kernel aio based

2015-03-19 Thread Maxim Patlasov
On 03/18/2015 07:57 PM, Ming Lei wrote: On Thu, Mar 19, 2015 at 2:28 AM, Maxim Patlasov wrote: On 01/13/2015 07:44 AM, Ming Lei wrote: Part of the patch is based on Dave's previous post. This patch submits I/O to fs via kernel aio, and we can obtain following benefits: - d

Re: [PATCH v2 4/4] block: loop: support to submit I/O via kernel aio based

2015-03-18 Thread Maxim Patlasov
On 01/13/2015 07:44 AM, Ming Lei wrote: Part of the patch is based on Dave's previous post. This patch submits I/O to fs via kernel aio, and we can obtain following benefits: - double cache in both loop file system and backend file gets avoided - context switch decreased

Re: [PATCH V8 00/33] loop: Issue O_DIRECT aio using bio_vec

2015-01-05 Thread Maxim Patlasov
On 12/31/2014 04:52 PM, Ming Lei wrote: On Thu, Jan 1, 2015 at 6:35 AM, Sedat Dilek wrote: On Wed, Dec 31, 2014 at 10:52 PM, Dave Kleikamp wrote: On 12/31/2014 02:38 PM, Sedat Dilek wrote: What has happened to that aio_loop patchset? Is it in Linux-next? ( /me started to play with "block: lo

Re: [PATCH 0/5] fuse: handle release synchronously (v4)

2014-10-16 Thread Maxim Patlasov
Hi Miklos, On 10/09/2014 12:14 PM, Miklos Szeredi wrote: On Wed, Oct 1, 2014 at 1:28 PM, Maxim Patlasov wrote: Given those patches must die, do you have any ideas how to resolve that "spurious EBUSY" problem? Check the "sync_release" branch of fuse: git://git.kern

Re: [PATCH 0/5] fuse: handle release synchronously (v4)

2014-10-01 Thread Maxim Patlasov
On 10/01/2014 12:44 AM, Linus Torvalds wrote: On Tue, Sep 30, 2014 at 12:19 PM, Miklos Szeredi wrote: What about flock(2), FL_SETLEASE, etc semantics (which are the sane ones, compared to the POSIX locks shit which mandates release of lock on each close(2) instead of "when all [duplicate] descr

[PATCH 5/5] fuse: enable close_wait synchronous release

2014-09-25 Thread Maxim Patlasov
e-back callback. Now, it's always safe because callbacks don't send requests to userspace anymore. The feature can be made privileged by means of DISABLE_SYNC_RELEASE mount option implemented by the previous patch. Signed-off-by: Maxim Patlasov --- fs/fuse/file.c |3 ++- 1 file change

[PATCH 4/5] fuse: add mount option to disable synchronous release

2014-09-25 Thread Maxim Patlasov
option by default for unprivileged mounts (allowing system administrator to configure it like "user_allow_other"). Signed-off-by: Maxim Patlasov --- fs/fuse/file.c |3 ++- fs/fuse/fuse_i.h |3 +++ fs/fuse/inode.c |8 3 files changed, 13 insertions(+), 1 deletio

[PATCH 3/5] fuse: wait for end of IO on release

2014-09-25 Thread Maxim Patlasov
async I/O, its callbacks (fuse_readpages_end and fuse_writepage_finish) calling fuse_file_put cannot be the last holders of fuse file anymore. To emphasize the fact, the patch replaces fuse_file_put with __fuse_file_put there. Signed-off-by: Maxim Patlasov --- fs/fuse/fil

[PATCH 1/5] fuse: add FOPEN_SYNC_RELEASE flag to ff->open_flags

2014-09-25 Thread Maxim Patlasov
The feature will be governed by fuse file open flag FOPEN_SYNC_RELEASE. Userspace can enable it on per file basis in the same way as for FOPEN_KEEP_CACHE or FOPEN_DIRECT_IO. Signed-off-by: Maxim Patlasov --- include/uapi/linux/fuse.h |3 +++ 1 file changed, 3 insertions(+) diff --git a

[PATCH 2/5] fuse: cosmetic rework of fuse_send_readpages

2014-09-25 Thread Maxim Patlasov
The patch change arguments of fuse_send_readpages to give it access to inode (will be used in the next patch of patch-set). The change is cosmetic, no logic changed. Signed-off-by: Maxim Patlasov --- fs/fuse/file.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions

[PATCH 0/5] fuse: handle release synchronously (v4)

2014-09-25 Thread Maxim Patlasov
userspace filesystem. Given the problem has existed for fuseblk mount for long time and there is no reasonable solution now, I put it aside for the future. Thanks, Maxim --- Maxim Patlasov (5): fuse: add FOPEN_SYNC_RELEASE flag to ff->open_flags fuse: cosmetic rework of fu

Re: [PATCH 5/6] fuse: fix synchronous case of fuse_file_put()

2014-09-24 Thread Maxim Patlasov
On 09/16/2014 12:19 PM, Miklos Szeredi wrote: On Thu, Sep 11, 2014 at 6:14 PM, Maxim Patlasov wrote: I really need your help to proceed with this patch. Could you please explain what those places are where we should allow interruption. BTW, as for "just an optimization", I&#

Re: [PATCH 5/6] fuse: fix synchronous case of fuse_file_put()

2014-09-11 Thread Maxim Patlasov
On 08/22/2014 06:08 PM, Miklos Szeredi wrote: On Thu, Aug 21, 2014 at 6:09 PM, Maxim Patlasov wrote: If fuse_file_put() is called with sync==true, the user may be blocked for a while, until userspace ACKs our FUSE_RELEASE request. This blocking must be uninterruptible. Otherwise request could

Re: [PATCH 0/2] fuse: fix regression in fuse_get_user_pages()

2014-09-10 Thread Maxim Patlasov
On 09/10/2014 01:51 PM, Miklos Szeredi wrote: On Wed, Sep 03, 2014 at 02:10:23PM +0400, Maxim Patlasov wrote: Hi, The patchset fixes a regression introduced by the following commits: c7f3888ad7f0 ("switch iov_iter_get_pages() to passing maximal number of pages") c9c37e2e6378 ("

[PATCH 2/2] fuse: fuse_get_user_pages(): do not pack more data than requested

2014-09-03 Thread Maxim Patlasov
ly calculated "maxsize" to the helper. Reported-by: Werner Baumann Signed-off-by: Maxim Patlasov --- fs/fuse/file.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 40ac262..1d2bb70 100644 --- a/fs/fuse/file.c +++ b/

[PATCH 1/2] vfs: switch iov_iter_get_pages() to passing maximal size

2014-09-03 Thread Maxim Patlasov
The patch reverts the commit c7f3888ad7f0 ("switch iov_iter_get_pages() to passing maximal number of pages") because FUSE do need maxsize argument that existed before that commit. Signed-off-by: Maxim Patlasov --- fs/direct-io.c |2 +- fs/fuse/file.c |4 ++-- inc

[PATCH 0/2] fuse: fix regression in fuse_get_user_pages()

2014-09-03 Thread Maxim Patlasov
dd if=/dev/zero of=/mnt/owncloud/test.txt bs=20417 count=1 > fails. Thanks, Maxim --- Maxim Patlasov (2): vfs: switch iov_iter_get_pages() to passing maximal size fuse: fuse_get_user_pages(): do not pack more data than requested fs/direct-io.c |2 +- fs/fuse/file.c

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-29 Thread Maxim Patlasov
On 08/28/2014 06:06 AM, Ming Lei wrote: On 8/28/14, Maxim Patlasov wrote: On 08/21/2014 09:44 AM, Ming Lei wrote: On Wed, Aug 20, 2014 at 4:50 AM, Jens Axboe wrote: Reworked a bit more: http://git.kernel.dk/?p=linux-block.git;a=commit;h=a323185a761b9a54dc340d383695b4205ea258b6 One big

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-29 Thread Maxim Patlasov
On 8/28/14, Zach Brown wrote: On Wed, Aug 27, 2014 at 09:19:36PM +0400, Maxim Patlasov wrote: On 08/27/2014 08:29 PM, Benjamin LaHaise wrote: On Wed, Aug 27, 2014 at 08:08:59PM +0400, Maxim Patlasov wrote: ... 1) /dev/loop0 of 3.17.0-rc1 with Ming's patches applied -- 11K iops 2) the

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-27 Thread Maxim Patlasov
On 08/27/2014 08:29 PM, Benjamin LaHaise wrote: On Wed, Aug 27, 2014 at 08:08:59PM +0400, Maxim Patlasov wrote: ... 1) /dev/loop0 of 3.17.0-rc1 with Ming's patches applied -- 11K iops 2) the same as above, but call loop_queue_work() directly from loop_queue_rq() -- 270K iops 3) /dev/null

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-27 Thread Maxim Patlasov
On 08/21/2014 09:44 AM, Ming Lei wrote: On Wed, Aug 20, 2014 at 4:50 AM, Jens Axboe wrote: Reworked a bit more: http://git.kernel.dk/?p=linux-block.git;a=commit;h=a323185a761b9a54dc340d383695b4205ea258b6 One big problem of the commit is that it is basically a serialized workqueue because of

[PATCH 3/6] fuse: wait for end of IO on release (v2)

2014-08-26 Thread Maxim Patlasov
ing around __fuse_file_put() Signed-off-by: Maxim Patlasov --- fs/fuse/file.c | 71 1 file changed, 66 insertions(+), 5 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 7723b3f..8713e62 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c

Re: [PATCH 5/6] fuse: fix synchronous case of fuse_file_put()

2014-08-25 Thread Maxim Patlasov
On 08/22/2014 06:08 PM, Miklos Szeredi wrote: On Thu, Aug 21, 2014 at 6:09 PM, Maxim Patlasov wrote: If fuse_file_put() is called with sync==true, the user may be blocked for a while, until userspace ACKs our FUSE_RELEASE request. This blocking must be uninterruptible. Otherwise request could

Re: [PATCH 4/6] fuse: enable close_wait synchronous release

2014-08-25 Thread Maxim Patlasov
On 08/22/2014 06:04 PM, Miklos Szeredi wrote: On Thu, Aug 21, 2014 at 6:09 PM, Maxim Patlasov wrote: The patch enables the feature by passing 'true' to fuse_file_put in fuse_release_common. Previously, this was safe only in special cases when we sure that multi-threaded users

Re: [PATCH 3/6] fuse: wait for end of IO on release

2014-08-25 Thread Maxim Patlasov
On 08/22/2014 06:00 PM, Miklos Szeredi wrote: On Thu, Aug 21, 2014 at 6:08 PM, Maxim Patlasov wrote: There are two types of I/O activity that can be "in progress" at the time of fuse_release() execution: asynchronous read-ahead and write-back. The patch ensures that they are comple

[PATCH 6/6] fuse: add mount option to disable synchronous release

2014-08-21 Thread Maxim Patlasov
completed by fuse daemon yet. To make testing such use cases easier, the patch introduces DISABLE_SYNC_RELEASE mount option which effectively mask out FOPEN_SYNC_RELEASE flag. Signed-off-by: Maxim Patlasov --- --- fs/fuse/file.c |3 ++- fs/fuse/fuse_i.h |3 +++ fs/fuse/inode.c |8

[PATCH 5/6] fuse: fix synchronous case of fuse_file_put()

2014-08-21 Thread Maxim Patlasov
If fuse_file_put() is called with sync==true, the user may be blocked for a while, until userspace ACKs our FUSE_RELEASE request. This blocking must be uninterruptible. Otherwise request could be interrupted, but file association in user space remains. Signed-off-by: Maxim Patlasov --- fs/fuse

[PATCH 2/6] fuse: cosmetic rework of fuse_send_readpages

2014-08-21 Thread Maxim Patlasov
The patch change arguments of fuse_send_readpages to give it access to inode (will be used in the next patch of patch-set). The change is cosmetic, no logic changed. Signed-off-by: Maxim Patlasov --- fs/fuse/file.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions

[PATCH 4/6] fuse: enable close_wait synchronous release

2014-08-21 Thread Maxim Patlasov
e-back callback. Now, it's always safe because callbacks don't send requests to userspace anymore. Signed-off-by: Maxim Patlasov --- fs/fuse/file.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 73bce1b..cd55488 100644 ---

[PATCH 3/6] fuse: wait for end of IO on release

2014-08-21 Thread Maxim Patlasov
async I/O, its callbacks (fuse_readpages_end and fuse_writepage_finish) calling fuse_file_put cannot be the last holders of fuse file anymore. To emphasize the fact, the patch replaces fuse_file_put with __fuse_file_put there. Signed-off-by: Maxim Patlasov --- fs/fuse/fil

[PATCH 1/6] fuse: add FOPEN_SYNC_RELEASE flag to ff->open_flags

2014-08-21 Thread Maxim Patlasov
The feature will be governed by fuse file open flag FOPEN_SYNC_RELEASE. Userspace can enable it on per file basis in the same way as for FOPEN_KEEP_CACHE or FOPEN_DIRECT_IO. Signed-off-by: Maxim Patlasov --- include/uapi/linux/fuse.h |3 +++ 1 file changed, 3 insertions(+) diff --git a

[PATCH 0/6] fuse: handle release synchronously (v3)

2014-08-21 Thread Maxim Patlasov
ease" instead of "wait on close") - enabled feature on per file basis (instead of global fuse_conn parameter) - added "disable_sync_release" mount option - rebased on v3.17-rc1 tag of Linus' tree. Thanks, Maxim --- Maxim Patlasov (6): fuse: add FOPEN_S

Re: [PATCH] fuse: do not evict dirty inodes

2014-08-15 Thread Maxim Patlasov
Hi Miklos, On 08/13/2014 02:32 PM, Miklos Szeredi wrote: On Tue, Jun 3, 2014 at 1:49 PM, Maxim Patlasov wrote: Commit 1e18bda8 added .write_inode method to the fuse super_operations. This allowed fuse to use the kernel infrastructure for writing out dirty metadata (mtime and ctime for now

Re: [PATCH 0/5] fuse: close file synchronously (v2)

2014-08-14 Thread Maxim Patlasov
On 08/13/2014 04:44 PM, Miklos Szeredi wrote: On Fri, Jun 6, 2014 at 3:27 PM, Maxim Patlasov wrote: Hi, There is a long-standing demand for synchronous behaviour of fuse_release: http://sourceforge.net/mailarchive/message.php?msg_id=19343889 http://sourceforge.net/mailarchive/message.php

Re: [PATCH] fuse: avoid scheduling while atomic

2014-07-14 Thread Maxim Patlasov
On 07/04/2014 08:27 PM, Miklos Szeredi wrote: Maxim, thanks for the patch. Here's a reworked one. While it looks a bit more complicated, its chances of being (and remaining) correct are, I think, better, since the region surrounded by kmap/kunmap_atomic is trivially non-sleeping. This patch al

Re: [PATCH] mm/page-writeback.c: fix divide by zero in bdi_dirty_limits

2014-07-14 Thread Maxim Patlasov
Hi Andrew, On 07/12/2014 02:27 AM, Andrew Morton wrote: On Fri, 11 Jul 2014 12:18:27 +0400 Maxim Patlasov wrote: Under memory pressure, it is possible for dirty_thresh, calculated by global_dirty_limits() in balance_dirty_pages(), to equal zero. Under what circumstances? Really small

[PATCH] mm/page-writeback.c: fix divide by zero in bdi_dirty_limits

2014-07-11 Thread Maxim Patlasov
zero. Signed-off-by: Maxim Patlasov --- mm/page-writeback.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 518e2c3..e0c9430 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -1306,9 +1306,9 @@ static inline

[PATCH] fuse: release temporary page if fuse_writepage_locked() failed

2014-07-10 Thread Maxim Patlasov
tmp_page to be freed if fuse_write_file_get() returns NULL. Signed-off-by: Maxim Patlasov --- fs/fuse/file.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 3a47aa2..a18baa4 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c

[PATCH] fuse: remove WARN_ON writeback on dead inode

2014-07-10 Thread Maxim Patlasov
ple, let's mmap a file, then issue O_DIRECT read to mmapped region and immediately close file and munmap. O_DIRECT will pin some pages, execute IO to them and then mark pages dirty. Here we are. Signed-off-by: Maxim Patlasov --- fs/fuse/file.c | 14 +++--- 1 file changed, 3 insertion

[PATCH] fuse: avoid scheduling while atomic

2014-06-25 Thread Maxim Patlasov
ith GFP_KERNEL, holding "struct fuse_copy_state" mapped by kmap_atomic(). The patch fixes the problem for fuse_notify_inval_entry() and other notifiers by unmapping fuse_copy_state before allocations and remapping it again afterwards. Reported-by: Richard Sharpe Signed-off-by: Maxim Patl

Re: [fuse-devel] [PATCH 0/5] fuse: close file synchronously (v2)

2014-06-09 Thread Maxim Patlasov
On 06/09/2014 03:11 PM, John Muir wrote: On 2014.06.09, at 12:46 , Maxim Patlasov wrote: On 06/09/2014 01:26 PM, John Muir wrote: On 2014.06.09, at 9:50 , Maxim Patlasov wrote: On 06/06/2014 05:51 PM, John Muir wrote: On 2014.06.06, at 15:27 , Maxim Patlasov wrote: The patch-set

Re: [fuse-devel] [PATCH 0/5] fuse: close file synchronously (v2)

2014-06-09 Thread Maxim Patlasov
On 06/09/2014 01:26 PM, John Muir wrote: On 2014.06.09, at 9:50 , Maxim Patlasov wrote: On 06/06/2014 05:51 PM, John Muir wrote: On 2014.06.06, at 15:27 , Maxim Patlasov wrote: The patch-set resolves the problem by making fuse_release synchronous: wait for ACK from userspace for

Re: [fuse-devel] [PATCH 0/5] fuse: close file synchronously (v2)

2014-06-09 Thread Maxim Patlasov
On 06/06/2014 05:51 PM, John Muir wrote: On 2014.06.06, at 15:27 , Maxim Patlasov wrote: The patch-set resolves the problem by making fuse_release synchronous: wait for ACK from userspace for FUSE_RELEASE if the feature is ON. Why not make this feature per-file with a new flag bit in struct

[PATCH 5/5] fuse: fix synchronous case of fuse_file_put()

2014-06-06 Thread Maxim Patlasov
If fuse_file_put() is called with sync==true, the user may be blocked for a while, until userspace ACKs our FUSE_RELEASE request. This blocking must be uninterruptible. Otherwise request could be interrupted, but file association in user space remains. Signed-off-by: Maxim Patlasov --- fs/fuse

[PATCH 4/5] fuse: enable close_wait feature

2014-06-06 Thread Maxim Patlasov
callback. Now, it's always safe because callbacks don't send requests to userspace anymore. Signed-off-by: Maxim Patlasov --- fs/fuse/file.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index d50af99..783cb52 100644 --- a/fs/fu

[PATCH 3/5] fuse: wait for end of IO on release

2014-06-06 Thread Maxim Patlasov
async I/O, its callbacks (fuse_readpages_end and fuse_writepage_finish) calling fuse_file_put cannot be the last holders of fuse file anymore. To emphasize the fact, the patch replaces fuse_file_put with __fuse_file_put there. Signed-off-by: Maxim Patlasov --- fs/fuse/fil

[PATCH 2/5] fuse: cosmetic rework of fuse_send_readpages

2014-06-06 Thread Maxim Patlasov
The patch change arguments of fuse_send_readpages to give it access to inode (will be used in the next patch of patch-set). The change is cosmetic, no logic changed. Signed-off-by: Maxim Patlasov --- fs/fuse/file.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions

[PATCH 0/5] fuse: close file synchronously (v2)

2014-06-06 Thread Maxim Patlasov
cannot trigger FUSE_RELEASE anymore. Hence, we'll never block in contexts other than close(). Changed in v2: - improved comments, commented spin_unlock_wait out according to Brian' suggestions. - rebased on v3.15-rc8 tag of Linus' tree. Thanks, Maxim --- Maxim Patlasov (5):

[PATCH 1/5] fuse: add close_wait flag to fuse_conn

2014-06-06 Thread Maxim Patlasov
The feature will be governed by fc->close_wait. Userspace can enable it in the same way as auto_inval_data or any other kernel fuse capability. Signed-off-by: Maxim Patlasov --- fs/fuse/fuse_i.h |3 +++ fs/fuse/inode.c |4 +++- include/uapi/linux/fuse.h |3 +++

[PATCH] fuse: do not evict dirty inodes

2014-06-03 Thread Maxim Patlasov
dirty inodes by calling sync_filesystem(). Signed-off-by: Maxim Patlasov --- fs/fuse/inode.c |1 - 1 file changed, 1 deletion(-) diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 754dcf2..ee017be 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -791,7 +791,6 @@ static const struct

Re: [PATCH] mm,writeback: fix divide by zero in pos_ratio_polynom

2014-04-30 Thread Maxim Patlasov
On 04/30/2014 12:12 PM, Michal Hocko wrote: On Wed 30-04-14 12:04:04, Maxim Patlasov wrote: Hi Rik! On 04/29/2014 11:19 PM, Rik van Riel wrote: It is possible for "limit - setpoint + 1" to equal zero, leading to a divide by zero error. Blindly adding 1 to "limit - setpoint"

Re: [PATCH] mm,writeback: fix divide by zero in pos_ratio_polynom

2014-04-30 Thread Maxim Patlasov
Hi Rik! On 04/29/2014 11:19 PM, Rik van Riel wrote: It is possible for "limit - setpoint + 1" to equal zero, leading to a divide by zero error. Blindly adding 1 to "limit - setpoint" is not working, so we need to actually test the divisor before calling div64. The patch looks correct, but I'm

[PATCH 7/7] fuse: flush ctime in FUSE_FORGET requests

2014-04-15 Thread Maxim Patlasov
ime()). The patch solves the problem by passing local ctime to the userspace server inside forget requests. Signed-off-by: Maxim Patlasov --- fs/fuse/dev.c | 30 +++--- fs/fuse/fuse_i.h |2 +- fs/fuse/inode.c |6 ++ include/uapi/li

[PATCH 6/7] fuse: clear FUSE_I_CTIME_DIRTY flag on setattr

2014-04-15 Thread Maxim Patlasov
DIRTY flag because actual ctime value was flushed to the server. Signed-off-by: Maxim Patlasov --- fs/fuse/dir.c | 38 ++ 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 2187960..3495aaf 100644 --- a/fs/fuse/

[PATCH 5/7] fuse: trust kernel i_ctime only

2014-04-15 Thread Maxim Patlasov
ode flag FUSE_I_CTIME_DIRTY serves as indication that local i_ctime should be flushed to the server eventually. The patch sets the flag and updates i_ctime in course of operations listed above. Signed-off-by: Maxim Patlasov --- fs/fuse/dir.c | 24 +++- fs/fuse/file.c |

[PATCH 4/7] fuse: introduce FUSE_I_CTIME_DIRTY flag

2014-04-15 Thread Maxim Patlasov
ure (fuse_flush_cmtime()). Further patches of the patch-set will implement the logic of setting and clearing the flag. Signed-off-by: Maxim Patlasov --- fs/fuse/dir.c | 22 ++ fs/fuse/file.c| 11 --- fs/fuse/fuse_i.h |4 +++- include/uapi/li

[PATCH 3/7] fuse: update mtime on open(O_TRUNC) in atomic_o_trunc mode

2014-04-15 Thread Maxim Patlasov
ing FUSE_I_MTIME_DIRTY flag. Signed-off-by: Maxim Patlasov --- fs/fuse/file.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 13f8bde..c2c6df7 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -223,6 +223,10 @@ v

[PATCH 2/7] fuse: update mtime on truncate(2)

2014-04-15 Thread Maxim Patlasov
Handling truncate(2), VFS doesn't set ATTR_MTIME bit in iattr structure; only ATTR_SIZE bit is set. In-kernel fuse must handle the case by setting mtime fields of struct fuse_setattr_in to "now" and set FATTR_MTIME bit even though ATTR_MTIME was not set. Signed-off-by: Maxim Pa

[PATCH 1/7] fuse: do not use uninitialized i_mode

2014-04-15 Thread Maxim Patlasov
When inode is in I_NEW state, inode->i_mode is not initialized yet. Do not use it before fuse_init_inode() is called. Signed-off-by: Maxim Patlasov --- fs/fuse/inode.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 8d61169..299e

[PATCH 0/7] fuse: fix handling mtime and cmtime in writeback_cache mode

2014-04-15 Thread Maxim Patlasov
ust ctime from server anymore because we doesn't flush all data changes to the server immediately - to maintain ctime locally, we have to update it in proper places (fuse_update_time, fallocate, setxattr, etc.) - locally updated ctime must be flushed to the server eventually. Ma

Re: [PATCH 07/11] fuse: restructure fuse_readpage()

2014-01-20 Thread Maxim Patlasov
On 01/06/2014 08:43 PM, Miklos Szeredi wrote: On Fri, Dec 20, 2013 at 06:54:40PM +0400, Maxim Patlasov wrote: Hi Miklos, Sorry for delay, see please inline comments below. On 11/12/2013 09:17 PM, Miklos Szeredi wrote: On Thu, Oct 10, 2013 at 05:11:25PM +0400, Maxim Patlasov wrote: Move the

Re: [PATCH 05/11] fuse: Trust kernel i_mtime only -v2

2014-01-20 Thread Maxim Patlasov
On 01/06/2014 08:22 PM, Miklos Szeredi wrote: On Thu, Dec 26, 2013 at 07:41:41PM +0400, Maxim Patlasov wrote: + + if (!err) + clear_bit(FUSE_I_MTIME_DIRTY, &fi->state); Doing the test and the clear separately opens a huge race window when i_mtime modifications are b

[PATCH 05/11] fuse: Trust kernel i_mtime only -v3

2013-12-26 Thread Maxim Patlasov
ime. Changed in v3 (thanks to Miklos): - let client fs know about local mtime change for ATTR_SIZE and !ATTR_MTIME_SET cases. Signed-off-by: Maxim Patlasov --- fs/fuse/dir.c| 113 +- fs/fuse/file.c | 30 -- fs/fuse/fuse_

Re: [PATCH 05/11] fuse: Trust kernel i_mtime only -v2

2013-12-26 Thread Maxim Patlasov
Hi Miklos, Sorry for delay, see please inline comments below. On 11/12/2013 08:52 PM, Miklos Szeredi wrote: On Thu, Oct 10, 2013 at 05:10:56PM +0400, Maxim Patlasov wrote: Let the kernel maintain i_mtime locally: - clear S_NOCMTIME - implement i_op->update_time() - flush mtime on fs

Re: [PATCH 07/11] fuse: restructure fuse_readpage()

2013-12-20 Thread Maxim Patlasov
Hi Miklos, Sorry for delay, see please inline comments below. On 11/12/2013 09:17 PM, Miklos Szeredi wrote: On Thu, Oct 10, 2013 at 05:11:25PM +0400, Maxim Patlasov wrote: Move the code filling and sending read request to a separate function. Future patches will use it for .write_begin

[PATCH] mm: add strictlimit knob -v2

2013-11-06 Thread Maxim Patlasov
sonable value. Changed in v2: - updated patch description and documentation Signed-off-by: Maxim Patlasov --- Documentation/ABI/testing/sysfs-class-bdi |8 +++ mm/backing-dev.c | 35 + 2 files changed, 43 insertions(+) diff --git a/Docu

Re: [PATCH] mm: add strictlimit knob

2013-11-06 Thread Maxim Patlasov
Hi Andrew, On 11/05/2013 02:01 AM, Andrew Morton wrote: On Fri, 01 Nov 2013 18:31:40 +0400 Maxim Patlasov wrote: "strictlimit" feature was introduced to enforce per-bdi dirty limits for FUSE which sets bdi max_ratio to 1% by default: http://www.http.com//article

[PATCH] mm: add strictlimit knob

2013-11-01 Thread Maxim Patlasov
. Signed-off-by: Maxim Patlasov --- mm/backing-dev.c | 35 +++ 1 file changed, 35 insertions(+) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index ce682f7..4ee1d64 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -234,11 +234,46 @@ s

Re: Disabling in-memory write cache for x86-64 in Linux II

2013-11-01 Thread Maxim Patlasov
On Thu 31-10-13 14:26:12, Karl Kiniger wrote: > On Tue 131029, Jan Kara wrote: > > On Fri 25-10-13 11:15:55, Karl Kiniger wrote: > > > On Fri 131025, Linus Torvalds wrote: > > > > Is it currently possible to somehow set above values per block device? > > Yes, to some extent. You can set /sys

[PATCH] fuse: Flush files on wb close -v2

2013-10-10 Thread Maxim Patlasov
in ff->count. This delays actual close until all fuse wb is completed. In case of "write cache" turned off, the flush is ensured by fuse_vma_close(). Changed in v2: - updated patch to be applied smoothly on top of "Trust kernel i_mtime only -v2". Signed-off-by: Maxim

[PATCH 09/11] fuse: fuse_flush() should wait on writeback

2013-10-10 Thread Maxim Patlasov
userspace yet if we won't ensure it explicitly. Signed-off-by: Maxim Patlasov --- fs/fuse/file.c |9 + 1 file changed, 9 insertions(+) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 642bd51..f23fc65 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -19,6 +19,7 @@ #in

[PATCH 11/11] fuse: Turn writeback cache on

2013-10-10 Thread Maxim Patlasov
d call the generic_file_aio_write to make use of the Linux page cache engine. Signed-off-by: Maxim Patlasov --- fs/fuse/file.c|5 + fs/fuse/fuse_i.h |4 fs/fuse/inode.c | 13 + include/uapi/linux/fuse.h |2 ++ 4 files changed, 24

[PATCH 10/11] fuse: Fix O_DIRECT operations vs cached writeback misorder - v2

2013-10-10 Thread Maxim Patlasov
nds that reorder operation. Fix this by making the fuse direct IO callback explicitly wait on the in-flight writeback to finish. Changed in v2: - do not wait on writeback if fuse_direct_io() call came from CUSE (because it doesn't use fuse inodes) Signed-off-by: Maxim Patlasov ---

[PATCH 08/11] fuse: Implement write_begin/write_end callbacks -v2

2013-10-10 Thread Maxim Patlasov
t of user data by incorrect crop of a secondary request to a stale inarg->size of the primary. Signed-off-by: Maxim Patlasov --- fs/fuse/file.c | 100 1 file changed, 100 insertions(+) diff --git a/fs/fuse/file.c b/fs/fuse/file.c i

[PATCH 06/11] fuse: Flush files on wb close -v2

2013-10-10 Thread Maxim Patlasov
Changed in v2: - updated patch to be applied smoothly on top of "Trust kernel i_mtime only -v2". Signed-off-by: Maxim Patlasov --- fs/fuse/file.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index eabe202..b4d4189 100644 --- a/fs/f

[PATCH 05/11] fuse: Trust kernel i_mtime only -v2

2013-10-10 Thread Maxim Patlasov
ime. Signed-off-by: Maxim Patlasov --- fs/fuse/dir.c| 109 -- fs/fuse/file.c | 30 +-- fs/fuse/fuse_i.h |6 ++- fs/fuse/inode.c | 13 +- 4 files changed, 138 insertions(+), 20 deletions(-) diff --git a/fs/fuse/dir.c b

[PATCH 07/11] fuse: restructure fuse_readpage()

2013-10-10 Thread Maxim Patlasov
Move the code filling and sending read request to a separate function. Future patches will use it for .write_begin -- partial modification of a page requires reading the page from the storage very similarly to what fuse_readpage does. Signed-off-by: Maxim Patlasov --- fs/fuse/file.c | 55

[PATCH 03/11] fuse: Connection bit for enabling writeback

2013-10-10 Thread Maxim Patlasov
From: Pavel Emelyanov Off (0) by default. Will be used in the next patches and will be turned on at the very end. Signed-off-by: Maxim Patlasov Signed-off-by: Pavel Emelyanov --- fs/fuse/fuse_i.h |3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h

[PATCH 04/11] fuse: Trust kernel i_size only - v4

2013-10-10 Thread Maxim Patlasov
From: Pavel Emelyanov Make fuse think that when writeback is on the inode's i_size is always up-to-date and not update it with the value received from the userspace. This is done because the page cache code may update i_size without letting the FS know. This assumption implies fixing the previou

[PATCH 02/11] fuse: Prepare to handle short reads

2013-10-10 Thread Maxim Patlasov
From: Pavel Emelyanov A helper which gets called when read reports less bytes than was requested. See patch #4 (trust kernel i_size only) for details. Signed-off-by: Maxim Patlasov Signed-off-by: Pavel Emelyanov --- fs/fuse/file.c | 21 + 1 file changed, 13 insertions

[PATCH 01/11] fuse: Linking file to inode helper

2013-10-10 Thread Maxim Patlasov
From: Pavel Emelyanov When writeback is ON every writeable file should be in per-inode write list, not only mmap-ed ones. Thus introduce a helper for this linkage. Signed-off-by: Maxim Patlasov Signed-off-by: Pavel Emelyanov --- fs/fuse/file.c | 33 +++-- 1 file

[PATCH v6 00/11] fuse: An attempt to implement a write-back cache policy

2013-10-10 Thread Maxim Patlasov
moved restructuring fuse_readpage to a separate patch - avoided use of union for fuse_fill_data - grabbed a ref to the request in fuse_send_writepages Changed in v6: - rebased on writepages.v2 branch of the fuse tree (beba4ae4c2fda4e03a813aec640586087fa80a8b) - added waiting for fuse wri

  1   2   3   >