Hi Al,
01/23/2013 08:17 PM, Al Viro wrote:
> On Tue, Jan 22, 2013 at 09:03:26PM +0400, Maxim Patlasov wrote:
>> If proc_get_inode() succeeded, but d_make_root() failed, pde_put() for
>> proc_root will be called twice: the first time due to iput() called from
>> d_make_root(
e_get_fr_sz() to fuse_get_user_size()
- simplified loop in fuse_page_descs_length_init()
- rebased on v3.7-rc2
Thanks,
Maxim
---
Maxim Patlasov (12):
fuse: general infrastructure for pages[] of variable size
fuse: categorize fuse_get_req()
fuse: rework fuse_retrieve()
fuse:
ges needed explicitly.
The patch doesn't make any logic changes.
Signed-off-by: Maxim Patlasov
---
fs/fuse/dev.c| 47 ++-
fs/fuse/file.c |4 ++--
fs/fuse/fuse_i.h | 15 ---
fs/fuse/inode.c |4 ++--
4 files cha
)
scattered over code. Now it's clear from the first glance when a caller need
fuse_req with page pointers.
The patch doesn't make any logic changes. In multi-page case, it silly
allocates array of FUSE_MAX_PAGES_PER_REQ page pointers. This will be amended
by future patches.
Signed-o
off-by: Maxim Patlasov
---
fs/fuse/dev.c | 25 +++--
1 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index a5d4440..1266a5c 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -1563,13 +1563,24 @@ static int fuse_retrieve(
The patch uses 'nr_pages' argument of fuse_readpages() as heuristics for the
number of page pointers to allocate.
This can be improved further by taking in consideration fc->max_read and gaps
between page indices, but it's not clear whether it's worthy or not.
Signed
The patch allocates as many page pointers in fuse_req as needed to cover
interval [pos .. pos+len-1]. Inline helper fuse_wr_pages() is introduced
to hide this cumbersome arithmetic.
Signed-off-by: Maxim Patlasov
---
fs/fuse/file.c | 13 +++--
1 files changed, 11 insertions(+), 2
fuse_do_ioctl() already calculates the number of pages it's going to use. It is
stored in 'num_pages' variable. So the patch simply uses it for allocating
fuse_req.
Signed-off-by: Maxim Patlasov
---
fs/fuse/file.c |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff
The ability to save page pointers along with lengths and offsets in fuse_req
will be useful to cover several iovec-s with a single fuse_req.
Per-request page_offset is removed because anybody who need it can use
req->page_descs[0].offset instead.
Signed-off-by: Maxim Patlasov
---
fs/fuse/de
gments described by req->page_descs[]. This will be useful
for next patches optimizing direct_IO.
Signed-off-by: Maxim Patlasov
---
fs/fuse/cuse.c |1 +
fs/fuse/dev.c |7 +++
fs/fuse/dir.c |1 +
fs/fuse/file.c | 20
4 files changed, 25 insertions(+)
The function does not modify iov_iter which 'i' points to.
Signed-off-by: Maxim Patlasov
---
include/linux/fs.h |2 +-
mm/filemap.c |2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index b33cfc9..8967baa 10
().
Signed-off-by: Maxim Patlasov
---
fs/fuse/file.c | 103 +++-
1 files changed, 49 insertions(+), 54 deletions(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 51996af..9934321 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1056,14
Let fuse_get_user_pages() pack as many iov-s to a single fuse_req as
possible. This is very beneficial in case of iov[] consisting of many
iov-s of relatively small sizes (e.g. PAGE_SIZE).
Signed-off-by: Maxim Patlasov
---
fs/fuse/file.c | 79
e.
Signed-off-by: Maxim Patlasov
---
fs/fuse/file.c | 25 +
1 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index fad8c7b..1a9ae5a 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1088,14 +1088,14 @@ static int fuse_get_
ostpone it until the issue is well discussed on the mailing list(s).
Signed-off-by: Maxim Patlasov
---
fs/fuse/dir.c|7 ++-
fs/fuse/file.c |8 +++-
fs/fuse/fuse_i.h |2 ++
fs/fuse/inode.c |3 ++-
4 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/fs/fuse/
Hi Stephen,
08/29/2013 01:47 PM, Stephen Rothwell пишет:
Hi Andrew,
After merging the akpm tree, today's linux-next build (sparc64 defconfig
and others) produced these warnings:
mm/page-writeback.c: In function 'balance_dirty_pages_ratelimited':
mm/page-writeback.c:1450:13: warning: 'bdi_thres
Hi,
08/29/2013 03:46 PM, Miklos Szeredi пишет:
On Fri, Aug 16, 2013 at 03:51:41PM +0400, Maxim Patlasov wrote:
The patch is for
git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git writepages.v2
The patch fixes a race between ftruncate(2), mmap-ed write and write(2):
1) An user
Hi,
08/29/2013 01:25 PM, Miklos Szeredi пишет:
On Wed, Aug 28, 2013 at 04:21:46PM +0400, Maxim Patlasov wrote:
The way how fuse calls truncate_pagecache() from fuse_change_attributes()
is completely wrong. Because, w/o i_mutex held, we never sure whether
'oldsize' and 'attr->
Hi,
08/29/2013 07:41 PM, Miklos Szeredi пишет:
On Fri, Aug 16, 2013 at 03:30:27PM +0400, Maxim Patlasov wrote:
The patch fixes a race between mmap-ed write and fallocate(PUNCH_HOLE):
1) An user makes a page dirty via mmap-ed write.
2) The user performs fallocate(2) with mode == PUNCH_HOLE
Miklos,
The patch-set fixes a few issues I found while reviewing your
recent "fixes for writepages" patch-set.
The patches are for writepages.v2. If they are OK, I'll re-check
them for for-next.
Thanks,
Maxim
---
Maxim Patlasov (5):
fuse: writepages: roll back changes
ing false.
Signed-off-by: Maxim Patlasov
---
fs/fuse/file.c |5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 135360e..575e44f 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1659,8 +1659,11 @@ static bool fuse_writepage_in_flig
roperly. The result
would be stale data written to the server to a file offset where zeros must be.
Signed-off-by: Maxim Patlasov
---
fs/fuse/file.c | 63
1 file changed, 54 insertions(+), 9 deletions(-)
diff --git a/fs/fuse/file.c b/fs/
d off
completely" was handled in fuse_send_writepage() by calling
fuse_writepage_finish() which updated BDI_WRITTEN unconditionally.
Signed-off-by: Maxim Patlasov
---
fs/fuse/file.c |6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
ind
ached
request comes to fuse_send_writepage(), i_size is already extended
and that stale range of a page will come to the server. The result is that
the user will see stale data where zeros are expected.
Signed-off-by: Maxim Patlasov
---
fs/fuse/file.c | 20 +++-
1 file changed,
All async fuse requests must be supplied with extra reference to a fuse file.
This is necessary to ensure that the fuse file is not released until all
in-flight requests are completed. Fuse secondary writeback requests must
obey this rule as well.
Signed-off-by: Maxim Patlasov
---
fs/fuse
roperly. The result
would be stale data written to the server to a file offset where zeros must be.
Changed in v2:
- avoid NULL pointer dereference in fuse_drop_writepage().
Signed-off-by: Maxim Patlasov
---
fs/fuse/file.c | 64
1 fi
On 10/02/2013 07:07 PM, Miklos Szeredi wrote:
On Wed, Oct 2, 2013 at 1:17 PM, Maxim Patlasov wrote:
If writeback happens while fuse is in FUSE_NOWRITE condition, the request
will be queued but not processed immediately (see fuse_flush_writepages()).
Until FUSE_NOWRITE becomes relaxed, more
#x27;ll re-check
> them for for-next.
Thanks,
Maxim
---
Maxim Patlasov (4):
fuse: writepages: roll back changes if request not found
fuse: writepages: crop secondary requests
fuse: writepage: update bdi writeout when deleting secondary request
fuse: writepages: protec
All async fuse requests must be supplied with extra reference to a fuse file.
This is necessary to ensure that the fuse file is not released until all
in-flight requests are completed. Fuse secondary writeback requests must
obey this rule as well.
Signed-off-by: Maxim Patlasov
---
fs/fuse
ing false.
Signed-off-by: Maxim Patlasov
---
fs/fuse/file.c |5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 135360e..575e44f 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1659,8 +1659,11 @@ static bool fuse_writepage_in_flig
d off
completely" was handled in fuse_send_writepage() by calling
fuse_writepage_finish() which updated BDI_WRITTEN unconditionally.
Signed-off-by: Maxim Patlasov
---
fs/fuse/file.c |6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
ind
be.
Similar problem may happen if secondary requests are attached to an in-flight
request that was already cropped.
The patch solves the issue by cropping all secondary requests in
fuse_writepage_end(). Thanks to Miklos for idea.
Signed-off-by: Maxim Patlasov
-
On 10/03/2013 01:57 PM, Miklos Szeredi wrote:
On Wed, Oct 02, 2013 at 09:38:32PM +0400, Maxim Patlasov wrote:
If writeback happens while fuse is in FUSE_NOWRITE condition, the request
will be queued but not processed immediately (see fuse_flush_writepages()).
Until FUSE_NOWRITE becomes relaxed
On 10/03/2013 02:26 PM, Miklos Szeredi wrote:
On Wed, Oct 02, 2013 at 09:38:43PM +0400, Maxim Patlasov wrote:
BDI_WRITTEN counter is used to estimate bdi bandwidth. It must be incremented
every time as bdi ends page writeback. No matter whether it was fulfilled by
actual write or by discarding
On 10/03/2013 07:14 PM, Miklos Szeredi wrote:
On Thu, Oct 03, 2013 at 05:28:30PM +0400, Maxim Patlasov wrote:
1. There is an in-flight primary request with a chain of secondary ones.
2. User calls ftruncate(2) to extend file; fuse_set_nowrite() makes
fi->writectr negative and starts wait
On 10/03/2013 08:09 PM, Miklos Szeredi wrote:
On Thu, Oct 3, 2013 at 5:50 PM, Maxim Patlasov wrote:
On 10/03/2013 07:14 PM, Miklos Szeredi wrote:
On Thu, Oct 03, 2013 at 05:28:30PM +0400, Maxim Patlasov wrote:
1. There is an in-flight primary request with a chain of secondary ones.
2. User
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
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
On Thu, Jul 11, 2013 at 10:51 PM, Jan Kara wrote:
> On Fri 05-07-13 19:53:36, Maxim Patlasov wrote:
>> The feature prevents mistrusted filesystems to grow a large number of dirty
>> pages before throttling. For such filesystems balance_dirty_pages always
>> check bdi counte
Miklos,
On 09/19/2013 08:11 PM, Miklos Szeredi wrote:
Maxim,
Please review and test these. I've appended them to writepages.v2 and for-next.
Thanks a lot for efforts. I'll start to work on it now and send you
feedback as soon as I get a progress.
Btw, adding fuse-devel to cc.
Thanks,
Max
The patch uses queue_delayed_work for __mark_inode_dirty. This should be safe
because even if queue_delayed_work returns false (if the work is already on
a queue), bdi_writeback_workfn will re-schedule itself by looking at
wb->b_dirty.
Signed-off-by: Maxim Patlasov
---
mm/backing-dev.c |
On 09/11/2013 02:12 PM, Miklos Szeredi wrote:
On Fri, Aug 30, 2013 at 1:33 PM, Maxim Patlasov wrote:
08/30/2013 01:13 PM, Miklos Szeredi пишет:
On Thu, Aug 29, 2013 at 6:41 PM, Miklos Szeredi wrote:
BTW, isn't it enough to do the filemap_write_and_wait() *plus* the
fuse_set_no
-linus branch of fuse.git
Signed-off-by: Maxim Patlasov
---
fs/fuse/file.c | 16 ++--
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index d409dea..f9f07c4 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -2484,8 +2484,15 @@ stati
nded either by write(2) or ftruncate(2) or fallocate(2).
> 4. mmap-ed write makes a page in the extended region dirty.
This patch adds necessary bits to fuse_file_fallocate() to protect from that
race.
Signed-off-by: Maxim Patlasov
---
fs/fuse/file.c |7 +++
1 file changed, 7 insertio
Hi Miklos,
On 10/03/2013 08:22 PM, Maxim Patlasov wrote:
On 10/03/2013 08:09 PM, Miklos Szeredi wrote:
On Thu, Oct 3, 2013 at 5:50 PM, Maxim Patlasov wrote:
On 10/03/2013 07:14 PM, Miklos Szeredi wrote:
On Thu, Oct 03, 2013 at 05:28:30PM +0400, Maxim Patlasov wrote:
1. There is an in
On 10/09/2013 12:20 PM, Maxim Patlasov wrote:
Hi Miklos,
On 10/03/2013 08:22 PM, Maxim Patlasov wrote:
On 10/03/2013 08:09 PM, Miklos Szeredi wrote:
On Thu, Oct 3, 2013 at 5:50 PM, Maxim Patlasov wrote:
On 10/03/2013 07:14 PM, Miklos Szeredi wrote:
On Thu, Oct 03, 2013 at 05:28:30PM +0400
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
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
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
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
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
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
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
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
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
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
---
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
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
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
08/30/2013 01:13 PM, Miklos Szeredi пишет:
On Thu, Aug 29, 2013 at 6:41 PM, Miklos Szeredi wrote:
BTW, isn't it enough to do the filemap_write_and_wait() *plus* the
fuse_set_nowrite()?
Thought about it a bit and I think this should do fine.
Any writes before the fallocate will go trough befor
iscussed on the mailing list(s).
Changed in v2:
- improved patch description to cover both sides of the issue.
Signed-off-by: Maxim Patlasov
---
fs/fuse/dir.c|7 ++-
fs/fuse/file.c |8 +++-
fs/fuse/fuse_i.h |2 ++
fs/fuse/inode.c |3 ++-
4 files changed, 17 insertions(+)
Hi Miklos,
08/30/2013 02:12 PM, Miklos Szeredi пишет:
On Fri, Aug 09, 2013 at 07:02:12PM +0400, Maxim Patlasov wrote:
08/06/2013 08:25 PM, Miklos Szeredi пишет:
Hmm. Direct IO on an mmaped file will do get_user_pages() which will
do the necessary page fault magic and ->page_mkwrite() will
09/03/2013 02:31 PM, Miklos Szeredi пишет:
On Fri, Aug 30, 2013 at 06:50:18PM +0400, Maxim Patlasov wrote:
Hi Miklos,
08/30/2013 02:12 PM, Miklos Szeredi пишет:
On Fri, Aug 09, 2013 at 07:02:12PM +0400, Maxim Patlasov wrote:
08/06/2013 08:25 PM, Miklos Szeredi пишет:
Hmm. Direct IO on an
xtent
tree (or block map). In that case the user will see stale data even after
fallocate is completed.
Signed-off-by: Maxim Patlasov
---
fs/ext4/inode.c | 17 +
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 0d424d7..6b
Hi Jan,
On 09/26/2013 10:53 PM, Jan Kara wrote:
Hello,
On Thu 26-09-13 21:32:07, Maxim Patlasov wrote:
While handling punch-hole fallocate, it's useless to truncate page cache
before removing the range from extent tree (or block map in indirect case)
because page cache can be re-popu
Hi,
On 09/27/2013 06:43 PM, Jan Kara wrote:
On Fri 27-09-13 17:05:18, Maxim Patlasov wrote:
On 09/26/2013 10:53 PM, Jan Kara wrote:
Hello,
On Thu 26-09-13 21:32:07, Maxim Patlasov wrote:
While handling punch-hole fallocate, it's useless to truncate page cache
before removing the
other truncation of pagecache after punch hole is done.
Signed-off-by: Maxim Patlasov
---
fs/ext4/inode.c |6 ++
1 file changed, 6 insertions(+)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 0d424d7..2984ddf 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3621,6 +3621,12 @
make memory overhead worse if implemented w/o this patch-set.
Thanks,
Maxim
---
Maxim Patlasov (6):
fuse: general infrastructure for pages[] of variable size
fuse: categorize fuse_get_req()
fuse: rework fuse_retrieve()
fuse: rework fuse_readpages()
fuse: rework fuse_perf
The patch removes inline array of FUSE_MAX_PAGES_PER_REQ page pointers from
fuse_req. Instead of that, req->pages may now point either to small inline
array or to an array allocated dynamically.
This essentially means that all callers of fuse_request_alloc[_nofs] should
pass the number of pages ne
The patch categorizes all fuse_get_req() invocations into three categories:
- fuse_get_req_nopages() - when caller doesn't care about req->pages
- fuse_get_req_onepage() - when caller need exactly one page
- fuse_get_req_multipage() - in other cases.
The decision to split one fuse_get_req() int
The patch reworks fuse_retrieve() to allocate only so many page pointers
as needed. The core part of the patch is the following calculation:
num_pages = (num + offset + PAGE_SIZE - 1) >> PAGE_SHIFT;
(thanks Miklos for formula). All other changes are moslty shuffling lines.
The patch also
The patch uses 'nr_pages' argument of fuse_readpages() as the heuristics for
number of page pointers to allocate.
This can be improved further by taking in consideration fc->max_read and gaps
between page indices, but it's not clear wheteher it's worthy or not.
---
fs/fuse/file.c | 10 -
The patch allocates as many page pointers in fuse_req as needed to cover
interval [pos .. pos+len-1]. FUSE_WR_PAGES macro is introduced to hide this
cumbersome arithmetics.
---
fs/fuse/file.c | 15 +++
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/fs/fuse/file.c b/f
fuse_do_ioctl() already calculates the number of pages it's going to use. It is
stored in 'num_pages' variable. So the patch simply uses it for allocating
fuse_req.
---
fs/fuse/file.c |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 84
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 previously introduced short-rea
The .writepages one is required to make each writeback request carry more than
one page on it.
Changed in v2:
- fixed fuse_prepare_write() to avoid reads beyond EOF
- fixed fuse_prepare_write() to zero uninitialized part of page
Original patch by: Pavel Emelyanov
Signed-off-by: Maxim V. Patlas
The problem is:
1. write cached data to a file
2. read directly from the same file (via another fd)
The 2nd operation may read stale data, i.e. the one that was in a file
before the 1st op. Problem is in how fuse manages writeback.
When direct op occurs the core kernel code calls filemap_write_a
request_end() wakes up a waiter,
the waiter allocates new request and submits it for background processing,
the processing ends in request_end() where another wakeup happens an so on.
Thanks,
Maxim
---
Maxim Patlasov (3):
fuse: make request allocations for background processing explicit
req() aware about the type. Next patches will use it.
Signed-off-by: Maxim Patlasov
---
fs/fuse/cuse.c |2 +-
fs/fuse/dev.c| 22 +++---
fs/fuse/file.c |5 +++--
fs/fuse/fuse_i.h |3 +++
fs/fuse/inode.c |1 +
5 files changed, 27 insertions(+), 6 deleti
Miklos wrote:
> A task may have at most one synchronous request allocated. So these
> requests need not be otherwise limited.
The patch re-works fuse_get_req() to follow this idea.
Signed-off-by: Maxim Patlasov
---
fs/fuse/dev.c | 21 +
1 files changed, 13 inse
The patch solves thundering herd problem. So far as previous patches ensured
that only allocations for background may block, it's safe to wake up one
waiter. Whoever it is, it will wake up another one in request_end() afterwards.
Signed-off-by: Maxim Patlasov
---
fs/fuse/dev.c |
ges_end) cannot trigger FUSE_RELEASE anymore. Hence, we'll
never block in contexts other than close().
Thanks,
Maxim
---
Maxim Patlasov (5):
fuse: add close_wait flag to fuse_conn
fuse: cosmetic rework of fuse_send_readpages
fuse: wait for end of IO on release
fuse: enabl
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 |5 -
include/uapi/linux/fuse.h |
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 | 20 +++-
1 files changed, 11 insertions(+), 9 deletions
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
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 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index aed9be2..dac3a7c 100644
--- a/fs/fu
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
lligently if writeback cache is on (see patch #7 (update
i_mtime
on buffered writes) for details.
- put enabling writeback cache under fusermount control; (see mount option
'allow_wbcache' introduced by patch #13 (turn writeback cache on))
- rebased on v3.7-rc5
Thanks,
Maxim
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 files changed, 19 insertions
There will be a .writepageS callback implementation which will need to
get a fuse_file out of a fuse_inode, thus make a helper for this.
Signed-off-by: Maxim Patlasov
Signed-off-by: Pavel Emelyanov
---
fs/fuse/file.c | 24
1 files changed, 16 insertions(+), 8
A helper which gets called when read reports less bytes than was requested.
See patch #6 (trust kernel i_size only) for details.
Signed-off-by: Maxim Patlasov
Signed-off-by: Pavel Emelyanov
---
fs/fuse/file.c | 21 +
1 files changed, 13 insertions(+), 8 deletions(-)
diff
The .writepages callback will issue writeback requests with more than one
page aboard. Make existing end/check code be aware of this.
Original patch by: Pavel Emelyanov
Signed-off-by: Maxim Patlasov
---
fs/fuse/file.c | 22 +++---
1 files changed, 15 insertions(+), 7
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 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index
short-read helper --
when a short read occurs the 'hole' is filled with zeroes.
fuse_file_fallocate() is also fixed because now we should keep i_size up to
date, so it must be updated if FUSE_FALLOCATE request succeeded.
Original patch by: Pavel Emelyanov
Signed-off-by: Maxim Patlasov
---
ents all bits related to flushing and clearing the flag.
Signed-off-by: Maxim Patlasov
---
fs/fuse/dir.c| 42 +
fs/fuse/file.c | 31 ++---
fs/fuse/fuse_i.h | 13 -
fs/fuse/inode.c | 79 +
immediately and thus the -wait part of the mentioned call will be no-op.
Do real wait on per-inode writepages list.
Signed-off-by: Maxim Patlasov
Signed-off-by: Pavel Emelyanov
---
fs/fuse/file.c | 26 +-
1 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/fs
The .writepages one is required to make each writeback request carry more than
one page on it.
Original patch by: Pavel Emelyanov
Signed-off-by: Maxim Patlasov
---
fs/fuse/file.c | 251
1 files changed, 250 insertions(+), 1 deletions
er.
Signed-off-by: Maxim Patlasov
---
fs/fuse/file.c | 18 +++---
1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 3274708..4e4f6fd 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1370,7 +1370,8 @@ static struct fuse_fil
userspace
yet if we won't ensure it explicitly.
Signed-off-by: Maxim Patlasov
---
fs/fuse/file.c |9 +
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 4e4f6fd..b73fe2a 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -17,6
ion.
Fix this by making the fuse direct IO callback explicitly wait on the
in-flight writeback to finish.
Original patch by: Pavel Emelyanov
Signed-off-by: Maxim Patlasov
---
fs/fuse/file.c | 40
1 files changed, 40 insertions(+), 0 deletions(-)
d
1 - 100 of 255 matches
Mail list logo