Re: [PATCH 2/2] fuse: wait for writeback in fuse_file_fallocate() -v2

2013-09-11 Thread Maxim Patlasov
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_nowrite()? Thou

Re: [PATCH 2/2] fuse: wait for writeback in fuse_file_fallocate() -v2

2013-09-11 Thread Miklos Szeredi
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_nowrite()? >> >> Thought about it a bit and I thi

Re: [PATCH 2/2] fuse: wait for writeback in fuse_file_fallocate() -v2

2013-08-30 Thread Maxim Patlasov
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

Re: [PATCH 2/2] fuse: wait for writeback in fuse_file_fallocate() -v2

2013-08-30 Thread 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 before the fallocate. i_mutex guarantees that o

Re: [PATCH 2/2] fuse: wait for writeback in fuse_file_fallocate() -v2

2013-08-29 Thread Miklos Szeredi
BTW, isn't it enough to do the filemap_write_and_wait() *plus* the fuse_set_nowrite()? Thanks, Miklos -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 2/2] fuse: wait for writeback in fuse_file_fallocate() -v2

2013-08-29 Thread Miklos Szeredi
On Thu, Aug 29, 2013 at 08:27:30PM +0400, Maxim Patlasov wrote: > >So having a barrier like FUSE_NOWRITE is good but then we need to take care > >of throwing away the truncated part of the queue. But that should be doable > >by passing the truncated range explicitly to fuse_release_nowrite(). >

Re: [PATCH 2/2] fuse: wait for writeback in fuse_file_fallocate() -v2

2013-08-29 Thread Maxim Patlasov
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|KEEP

Re: [PATCH 2/2] fuse: wait for writeback in fuse_file_fallocate() -v2

2013-08-29 Thread 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|KEEP_SIZE >and covering the page. > 3) Bef

Re: [PATCH 2/2] fuse: wait for writeback in fuse_file_fallocate() -v2

2013-08-23 Thread Brian Foster
On 08/16/2013 07:30 AM, 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|KEEP_SIZE >and covering the page. > 3) Before truncate_pagec

Re: [PATCH 2/2] fuse: wait for writeback in fuse_file_fallocate()

2013-08-13 Thread Maxim Patlasov
08/13/2013 05:23 PM, Brian Foster пишет: On 08/13/2013 08:56 AM, Maxim Patlasov wrote: Hi, 08/13/2013 04:05 PM, Brian Foster пишет: ... @@ -2478,8 +2516,11 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset, if (lock_inode) { mutex_lock(&inode->i_

Re: [PATCH 2/2] fuse: wait for writeback in fuse_file_fallocate()

2013-08-13 Thread Brian Foster
On 08/13/2013 08:56 AM, Maxim Patlasov wrote: > Hi, > > 08/13/2013 04:05 PM, Brian Foster пишет: >> ... >> @@ -2478,8 +2516,11 @@ static long fuse_file_fallocate(struct file >> *file, int mode, loff_t offset, >> if (lock_inode) { >> mutex_lock(&inode->i_mutex); >> -if (mo

Re: [PATCH 2/2] fuse: wait for writeback in fuse_file_fallocate()

2013-08-13 Thread Maxim Patlasov
Hi, 08/13/2013 04:05 PM, Brian Foster пишет: ... @@ -2478,8 +2516,11 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset, if (lock_inode) { mutex_lock(&inode->i_mutex); - if (mode & FALLOC_FL_PUNCH_HOLE) - fuse

Re: [PATCH 2/2] fuse: wait for writeback in fuse_file_fallocate()

2013-08-13 Thread Brian Foster
On 08/12/2013 12:39 PM, 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|KEEP_SIZE >and covering the page. > 3) Before truncate_pagec