[PATCH] fuse: hotfix truncate_pagecache() issue -v2

2013-08-30 Thread Maxim Patlasov
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->size' are valid by the time of execution of truncate_pagecache(inode, oldsize, attr->size). In fact, as soon as we released fc->lock

[PATCH] fuse: hotfix truncate_pagecache() issue -v2

2013-08-30 Thread Maxim Patlasov
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-size' are valid by the time of execution of truncate_pagecache(inode, oldsize, attr-size). In fact, as soon as we released fc-lock in

Re: [PATCH] fuse: hotfix truncate_pagecache() issue

2013-08-29 Thread Miklos Szeredi
On Thu, Aug 29, 2013 at 3:01 PM, Maxim Patlasov wrote: > The patch looks fine, but it solves only one side of the problem (exactly > what you formulated above). Another side is opposite: truncating page cache > too late, when the state of inode changed significantly. The beginning may > be as in

Re: [PATCH] fuse: hotfix truncate_pagecache() issue

2013-08-29 Thread Maxim Patlasov
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->size' are valid by

Re: [PATCH] fuse: hotfix truncate_pagecache() issue

2013-08-29 Thread 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->size' are valid by the time of execution of >

Re: [PATCH] fuse: hotfix truncate_pagecache() issue

2013-08-29 Thread 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-size' are valid by the time of execution of

Re: [PATCH] fuse: hotfix truncate_pagecache() issue

2013-08-29 Thread Maxim Patlasov
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-size' are valid by

Re: [PATCH] fuse: hotfix truncate_pagecache() issue

2013-08-29 Thread Miklos Szeredi
On Thu, Aug 29, 2013 at 3:01 PM, Maxim Patlasov mpatla...@parallels.com wrote: The patch looks fine, but it solves only one side of the problem (exactly what you formulated above). Another side is opposite: truncating page cache too late, when the state of inode changed significantly. The

[PATCH] fuse: hotfix truncate_pagecache() issue

2013-08-28 Thread Maxim Patlasov
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->size' are valid by the time of execution of truncate_pagecache(inode, oldsize, attr->size). In fact, as soon as we released fc->lock

[PATCH] fuse: hotfix truncate_pagecache() issue

2013-08-28 Thread Maxim Patlasov
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-size' are valid by the time of execution of truncate_pagecache(inode, oldsize, attr-size). In fact, as soon as we released fc-lock in