[PATCH v2] sparse: use force attribute for vm_fault_t casts

2022-05-14 Thread Vasily Averin
:58: sparse: got restricted vm_fault_t [assigned] [usertype] ret vm_fault_t type is bitwise and requires __force attribute for any casts. Signed-off-by: Vasily Averin --- v2: improved according to the recommendations of Matthew Wilcox: - __force cast moved into internal functions

[PATCH] sparse: use force attribute for vm_fault_t casts

2022-05-14 Thread Vasily Averin
:58: sparse: got restricted vm_fault_t [assigned] [usertype] ret vm_fault_t type is bitwise and requires __force attribute for any casts. Signed-off-by: Vasily Averin --- fs/dax.c | 22 +++--- include/linux/mm_types.h | 30 -- 2 files

[PATCH] tracing: remove WARN_ON in start_thread()

2020-11-18 Thread Vasily Averin
er_start+0xc9/0xd0 Fixes: 978defee11a5 ("tracing: Do a WARN_ON() if start_thread() in hwlat is called when thread exists") Signed-off-by: Vasily Averin --- kernel/trace/trace_hwlat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace_hwlat.c b/kerne

Re: [PATCH] fuse_writepages_fill: simplified "if-else if" constuction

2020-07-14 Thread Vasily Averin
On 7/14/20 3:24 PM, Miklos Szeredi wrote: > On Thu, Jun 25, 2020 at 11:30 AM Vasily Averin wrote: >> >> fuse_writepages_fill uses following construction: >> if (wpa && ap->num_pages && >> (A || B || C)) { >> action; >> } else

Re: [PATCH] fuse_writepages_fill() optimization to avoid WARN_ON in tree_insert

2020-07-13 Thread Vasily Averin
On 7/13/20 7:14 PM, Miklos Szeredi wrote: > On Mon, Jul 13, 2020 at 10:02 AM Vasily Averin wrote: >> >> On 7/11/20 7:01 AM, Miklos Szeredi wrote: >>> On Thu, Jun 25, 2020 at 11:02 AM Vasily Averin wrote: >>>> >>>> In current implementation fuse_wri

Re: [5.8RC4][bugreport]WARNING: CPU: 28 PID: 211236 at fs/fuse/file.c:1684 tree_insert+0xaf/0xc0 [fuse]

2020-07-13 Thread Vasily Averin
r debug >> purpose? >> Now this line is often called when I start the container. >> > > That odd, but I can't send an email to the author of the commit. > mpatlasov wasn't found at virtuozzo.com. Reported problem is not fixed yet in 5.8-rc kernels Please take look at https://lkml.org/lkml/2020/7/13/265 Thank you, Vasily Averin

Re: [PATCH] fuse_writepages_fill() optimization to avoid WARN_ON in tree_insert

2020-07-13 Thread Vasily Averin
On 7/11/20 7:01 AM, Miklos Szeredi wrote: > On Thu, Jun 25, 2020 at 11:02 AM Vasily Averin wrote: >> >> In current implementation fuse_writepages_fill() tries to share the code: >> for new wpa it calls tree_insert() with num_pages = 0 >> then switches to common code

[PATCH] fuse_writepages ignores errors from fuse_writepages_fill

2020-06-25 Thread Vasily Averin
ned-off-by: Vasily Averin --- fs/fuse/file.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index c023f7f0..5986739 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -2148,10 +2148,8 @@ static int fuse_writepages(struct address_space *mapping,

[PATCH] fuse_writepages_fill: simplified "if-else if" constuction

2020-06-25 Thread Vasily Averin
ot;if" and "else if" calls the same action and can be merged. Signed-off-by: Vasily Averin --- fs/fuse/file.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index cf267bd..c023f7f0 100644 --- a/fs/fuse/file.c +++ b

[PATCH] fuse_writepages_fill() optimization to avoid WARN_ON in tree_insert

2020-06-25 Thread Vasily Averin
ill() to call tree_insert() with num_pages = 1 and avoids its subsequent increment and an extra spin_lock(&fi->lock) for newly added wpa. Fixes: 6b2fb79963fb ("fuse: optimize writepages search") Reported-by: kernel test robot Signed-off-by: Vasily Averin ---

Re: [fuse] 6b2fb79963: WARNING:at_fs/fuse/file.c:#tree_insert[fuse]

2020-06-25 Thread Vasily Averin
On 6/16/20 3:35 PM, Miklos Szeredi wrote: > On Mon, Jun 15, 2020 at 7:59 AM Vasily Averin wrote: >> >> On 6/15/20 3:50 AM, kernel test robot wrote: >>> FYI, we noticed the following commit (built with gcc-9): >>> >>> commit: 6b2fb79963fbed7

Re: [fuse] 6b2fb79963: WARNING:at_fs/fuse/file.c:#tree_insert[fuse]

2020-06-14 Thread Vasily Averin
gt;ia.ap.num_pages - 1; ... + WARN_ON(!wpa->ia.ap.num_pages); Miklos, do you have any objections if I return to our initial proposal? Am I missed something and it is not allowed now? Thank you, Vasily Averin diff --git a/fs/fuse/file.c b/fs/fuse/file.c index e573b0c..b8c

Re: [PATCH] lib/lz4: smatch warning in LZ4_decompress_generic()

2020-06-06 Thread Vasily Averin
Dear Yann, could you please consult us about your lz4 pacth https://github.com/lz4/lz4/commit/1a191b3f8d26b50a7c1d41590b529ec308d768cd Please see details below. Thank you, Vasily Averin On 6/6/20 5:36 PM, Gao Xiang wrote: > On Sat, Jun 06, 2020 at 04:28:02PM +0300, Vasily Averin wr

[PATCH] lib/lz4: smatch warning in LZ4_decompress_generic()

2020-06-06 Thread Vasily Averin
r module") Signed-off-by: Vasily Averin --- lib/lz4/lz4_decompress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lz4/lz4_decompress.c b/lib/lz4/lz4_decompress.c index 0c9d3ad..f7f7dca 100644 --- a/lib/lz4/lz4_decompress.c +++ b/lib/lz4/lz4_decompress.c @@ -

Re: [PATCH] ipc/util.c: sysvipc_find_ipc() incorrectly updates position index

2020-05-12 Thread Vasily Averin
On 5/12/20 12:21 PM, Jiri Slaby wrote: > On 08. 05. 20, 12:01, Vasily Averin wrote: >> On 5/8/20 9:07 AM, Vasily Averin wrote: >>> On 5/8/20 6:36 AM, Matthew Wilcox wrote: >>>> On Thu, May 07, 2020 at 05:02:42PM -0700, Andrew Morton wrote: >>>>>

Re: [PATCH] ipc/util.c: sysvipc_find_ipc() incorrectly updates position index

2020-05-08 Thread Vasily Averin
On 5/8/20 9:07 AM, Vasily Averin wrote: > On 5/8/20 6:36 AM, Matthew Wilcox wrote: >> On Thu, May 07, 2020 at 05:02:42PM -0700, Andrew Morton wrote: >>> Here's how I resolved things. Please check? >>> >>> static struct kern_ipc_perm *sysvipc_find

Re: [PATCH] ipc/util.c: sysvipc_find_ipc() incorrectly updates position index

2020-05-07 Thread Vasily Averin
est index * not yet in the array. This allows @xas to be immediately passed to * xas_store(). Matthew, could you please clarify this question? Thank you, Vasily Averin

Re: [PATCH] ipc/util.c: sysvipc_find_ipc() incorrectly updates position index

2020-05-07 Thread Vasily Averin
Dear Andrew, could you please handle it, it fixes broken ipcs in last mainline and stable kernels, and on all its derivatives. Thank you, Vasily Averin On 5/6/20 6:59 PM, Waiman Long wrote: > On 5/6/20 2:25 AM, Vasily Averin wrote: >> new_pos should jump through hole of u

[PATCH] ipc/util.c: sysvipc_find_ipc() incorrectly updates position index

2020-05-05 Thread Vasily Averin
new_pos should jump through hole of unused ids, pos can be updated inside "for" cycle. Cc: sta...@vger.kernel.org Fixes: 89163f93c6f9 ("ipc/util.c: sysvipc_find_ipc() should increase position index") Signed-off-by: Vasily Averin --- ipc/util.c | 12 ++-- 1 file c

Re: [PATCH 7/7] sysvipc_find_ipc should increase position index

2020-05-05 Thread Vasily Averin
root 64400 Thank you, Vasily Averin

Re: [PATCH 1/1] drm/qxl: add mutex_lock/mutex_unlock to ensure the order in which resources are rele

2020-04-28 Thread Vasily Averin
rue); - if (ret) - qxl_release_backoff_reserve_list(release); <<<< - else - qxl_release_fence_buffer_objects(release); - out_free_bos: out_free_release: Thank you, Vasily Averin

[PATCH] fuse: lost unlock_page in fuse_writepage()

2019-09-13 Thread Vasily Averin
unlock_page() was lost in fuse_writepage() Fixes commit ff17be086477 ("fuse: writepage: skip already in flight") # 3.13+ Signed-off-by: Vasily Averin --- fs/fuse/file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 5ae2828beb00..91c99724d

[PATCH] fuse: BUG_ON correction in fuse_dev_splice_write()

2019-08-18 Thread Vasily Averin
commit 963545357202 ("fuse: reduce allocation size for splice_write") changed size of bufs array, so BUG_ON which checks the index of the array shold also be fixed. Fixes: 963545357202 ("fuse: reduce allocation size for splice_write") Signed-off-by: Vasily Averin --

Re: [PATCH] fuse: BUG_ON's correction in fuse_dev_splice_write()

2019-08-18 Thread Vasily Averin
On 8/1/19 2:01 PM, Miklos Szeredi wrote: > On Tue, Jul 23, 2019 at 8:33 AM Vasily Averin wrote: >> >> commit 963545357202 ("fuse: reduce allocation size for splice_write") >> changed size of bufs array, so first BUG_ON should be corrected too. >> Second

[PATCH] fuse: redundant get_fuse_inode() calls in fuse_writepages_fill()

2019-08-18 Thread Vasily Averin
Currently fuse_writepages_fill() calls get_fuse_inode() few times with the same argument. Signed-off-by: Vasily Averin --- fs/fuse/file.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index e076c2cf65b0..bc9b64ef7b5d 100644 --- a/fs/fuse

[PATCH] fuse: BUG_ON's correction in fuse_dev_splice_write()

2019-07-22 Thread Vasily Averin
ot;fuse: reduce allocation size for splice_write") Signed-off-by: Vasily Averin --- fs/fuse/dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index ea8237513dfa..311c7911271c 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -2064,8 +2064

[tip:locking/urgent] futex: Cleanup generic SMP variant of arch_futex_atomic_op_inuser()

2019-07-22 Thread tip-bot for Vasily Averin
Commit-ID: f9adc23ee91e6f561bb70c6147d8d45bd164d62f Gitweb: https://git.kernel.org/tip/f9adc23ee91e6f561bb70c6147d8d45bd164d62f Author: Vasily Averin AuthorDate: Tue, 16 Jul 2019 09:22:03 +0300 Committer: Thomas Gleixner CommitDate: Mon, 22 Jul 2019 11:20:10 +0200 futex: Cleanup

Re: [PATCH] fuse: cleanup fuse_wait_on_page_writeback

2019-07-22 Thread Vasily Averin
I forget to add this patch was used in OpenVZ kernels last few years. On 7/22/19 10:17 AM, Vasily Averin wrote: > From: Maxim Patlasov > fuse_wait_on_page_writeback() always returns zero and nobody cares. > Let's make it void. > > Signed-off-by: Maxim Patlasov > Signe

[PATCH] fuse: cleanup fuse_wait_on_page_writeback

2019-07-22 Thread Vasily Averin
From: Maxim Patlasov fuse_wait_on_page_writeback() always returns zero and nobody cares. Let's make it void. Signed-off-by: Maxim Patlasov Signed-off-by: Vasily Averin --- fs/fuse/file.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/f

[PATCH] connector: remove redundant input callback from cn_dev

2019-07-17 Thread Vasily Averin
A small cleanup: this callback is never used. Originally fixed by Stanislav Kinsburskiy for OpenVZ7 bug OVZ-6877 cc: stanislav.kinsburs...@gmail.com Signed-off-by: Vasily Averin --- drivers/connector/connector.c | 6 +- include/linux/connector.h | 1 - 2 files changed, 1 insertion

Re: [PATCH v3 1/3] kernel/notifier.c: avoid duplicate registration

2019-07-17 Thread Vasily Averin
t, > and it is not really registered. If you call notifier_call_chain > after ko is unloaded, it will trigger oops. > > If the system is configured with softlockup_panic and the same > hook is repeatedly registered on the panic_notifier_list, it > will cause a loop p

Re: [PATCH v3 0/3] kernel/notifier.c: avoid duplicate registration

2019-07-17 Thread Vasily Averin
On 7/16/19 5:07 PM, Xiaoming Ni wrote: > On 2019/7/16 18:20, Vasily Averin wrote: >> On 7/16/19 5:00 AM, Xiaoming Ni wrote: >>> On 2019/7/15 13:38, Vasily Averin wrote: >>>> On 7/14/19 5:45 AM, Xiaoming Ni wrote: >>>>> On 2019/7/12 22:07, gre...@lin

Re: [PATCH v3 0/3] kernel/notifier.c: avoid duplicate registration

2019-07-16 Thread Vasily Averin
On 7/16/19 5:00 AM, Xiaoming Ni wrote: > On 2019/7/15 13:38, Vasily Averin wrote: >> On 7/14/19 5:45 AM, Xiaoming Ni wrote: >>> On 2019/7/12 22:07, gre...@linuxfoundation.org wrote: >>>> On Fri, Jul 12, 2019 at 09:11:57PM +0800, Xiaoming Ni wrote: >>>>

[PATCH v2] futex: generic arch_futex_atomic_op_inuser() cleanup

2019-07-15 Thread Vasily Averin
generic smp version of arch_futex_atomic_op_inuser() always returns -ENOSYS Signed-off-by: Vasily Averin --- include/asm-generic/futex.h | 21 + 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/include/asm-generic/futex.h b/include/asm-generic/futex.h index

Re: [PATCH] generic arch_futex_atomic_op_inuser() cleanup

2019-07-15 Thread Vasily Averin
Looks like this code is dead and therefore looks strange. I've found it during manual code review and decided to send patch to pay your attention to this problem. Probably it's better to remove this code at all? On 7/15/19 1:27 PM, Vasily Averin wrote: > Access to 'op' va

[PATCH] generic arch_futex_atomic_op_inuser() cleanup

2019-07-15 Thread Vasily Averin
Access to 'op' variable does not require pagefault_disable(), 'ret' variable should be initialized before using, 'oldval' variable can be replaced by constant. Signed-off-by: Vasily Averin --- include/asm-generic/futex.h | 8 ++-- 1 file changed, 2 insertions(

Re: [PATCH v3 0/3] kernel/notifier.c: avoid duplicate registration

2019-07-14 Thread Vasily Averin
On 7/14/19 5:45 AM, Xiaoming Ni wrote: > On 2019/7/12 22:07, gre...@linuxfoundation.org wrote: >> On Fri, Jul 12, 2019 at 09:11:57PM +0800, Xiaoming Ni wrote: >>> On 2019/7/11 21:57, Vasily Averin wrote: >>>> On 7/11/19 4:55 AM, Nixiaoming wrote: >>>>>

Re: [PATCH v3 0/3] kernel/notifier.c: avoid duplicate registration

2019-07-11 Thread Vasily Averin
On 7/11/19 4:55 AM, Nixiaoming wrote: > On Wed, July 10, 2019 1:49 PM Vasily Averin wrote: >> On 7/10/19 6:09 AM, Xiaoming Ni wrote: >>> Registering the same notifier to a hook repeatedly can cause the hook >>> list to form a ring or lose other members of the list. >

Re: [PATCH v3 0/3] kernel/notifier.c: avoid duplicate registration

2019-07-09 Thread Vasily Averin
On 7/10/19 6:09 AM, Xiaoming Ni wrote: > Registering the same notifier to a hook repeatedly can cause the hook > list to form a ring or lose other members of the list. I think is not enough to _prevent_ 2nd register attempt, it's enough to detect just attempt and generate warning to mark host in b

Re: [PATCH] notifiers: double register detection

2019-03-12 Thread Vasily Averin
to detect similar problem on OpenVz kernel. Mistakes with notifiers register can happen for example during subsystem initilazation from different namespaces, or because of lost unregister in roll-back path on initialization failures. Thank you, Vasily Averin On 3/12/19 11:06 AM, Vasily Av

[PATCH] notifiers: double register detection

2019-03-12 Thread Vasily Averin
By design notifiers can be registerd once only, 2nd register attempt called by mistake silently corrupts notifiers list. Proposed check cannot prevent described problem, however it allows to detect its reason quickly without coredump analyze. Signed-off-by: Vasily Averin --- kernel/notifier.c

Re: [PATCH] mm: cleancache: fix corruption on missed inode invalidation

2018-11-15 Thread Vasily Averin
On 11/16/18 1:31 AM, Andrew Morton wrote: > On Mon, 12 Nov 2018 12:57:34 +0300 Pavel Tikhomirov > wrote: > >> If all pages are deleted from the mapping by memory reclaim and also >> moved to the cleancache: >> >> __delete_from_page_cache >> (no shadow case) >> unaccount_page_cache_page >>

[PATCH v3] ext4: missing !bh check in ext4_xattr_inode_write()

2018-11-08 Thread Vasily Averin
file system corruption (although that would be highly unlikely given that we had *just* allocated the blocks and so the metadata blocks in question probably would still be in the cache). Fixes e50e5129f384 ("ext4: xattr-in-inode support") Cc: sta...@kernel.org # 4.13 Signed-off-by

[PATCH v2] ext4: missing !bh check in ext4_xattr_inode_write()

2018-11-07 Thread Vasily Averin
file system corruption (although that would be highly unlikely given that we had *just* allocated the blocks and so the metadata blocks in question probably would still be in the cache). Fixes e50e5129f384 ("ext4: xattr-in-inode support") Cc: sta...@kernel.org # 4.13 Signed-off-by

[PATCH v2] ext4: lost brelse in __ext4_read_dirblock()

2018-11-07 Thread Vasily Averin
Fixes dc6982ff4db1 ("ext4: refactor code to read directory blocks ...") Cc: sta...@kernel.org # 3.9 Signed-off-by: Vasily Averin --- fs/ext4/namei.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index d388cce72db2..6a6b90363ef1 100644 ---

Re: [PATCH 1/7] ext4: lost brelse in __ext4_read_dirblock()

2018-11-07 Thread Vasily Averin
I was wrong here, but brelse is lost in next error in this function. I'll resend new patch. On 11/7/18 6:25 PM, Theodore Y. Ts'o wrote: > On Wed, Oct 31, 2018 at 10:12:18PM +0300, Vasily Averin wrote: >> Fixes dc6982ff4db1 ("ext4: refactor code to read directory blocks

Re: [PATCH] ext4: remove code duplication in free_ind_block()

2018-11-05 Thread Vasily Averin
extend_credit_for_blkdel() and ext4_free_blocks(). In the same situation free_ind_blocks() returns without calling of these functions. Is it OK? Thank you, Vasily Averin On 11/6/18 9:13 AM, Vasily Averin wrote: > free_ind_block(), free_dind_blocks() and free_tind_blocks() are replaced > by a single rec

[PATCH] ext4: remove code duplication in free_ind_block()

2018-11-05 Thread Vasily Averin
free_ind_block(), free_dind_blocks() and free_tind_blocks() are replaced by a single recursive function. Signed-off-by: Vasily Averin --- fs/ext4/migrate.c | 115 +- 1 file changed, 32 insertions(+), 83 deletions(-) diff --git a/fs/ext4/migrate.c b

[PATCH v2] mm: use kvzalloc for swap_info_struct allocation

2018-11-05 Thread Vasily Averin
quires order-4 page. Switch to kvzmalloc allows to avoid unexpected allocation failures. Acked-by: Aaron Lu Signed-off-by: Vasily Averin --- mm/swapfile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/swapfile.c b/mm/swapfile.c index 644f746e167a..8688ae65ef58 10064

[PATCH v2] ext4: remove code duplication in update_ind/bind/tind_extent_range

2018-11-05 Thread Vasily Averin
update_ind/bind/tind_extent_page() differs by one variable and can be replaced by unified function. These functions are called by similar way and their caller function can be simplified too. v2: minor style changes, thanks to Andreas Dilger Reviewed-by: Andreas Dilger Signed-off-by: Vasily

Re: [PATCH 2/2] mm: avoid unnecessary swap_info_struct allocation

2018-11-05 Thread Vasily Averin
18 8:19 AM, Vasily Averin wrote: > On 11/5/18 3:57 AM, Huang, Ying wrote: >> Vasily Averin writes: >> >>> Currently newly allocated swap_info_struct can be quickly freed. >>> This patch avoid uneccessary high-order page allocation and helps >>> to decrease the me

Re: [LKP] [ext4 resize] 1ee5ee5ec3: WARNING:at_fs/buffer.c:#__brelse

2018-11-04 Thread Vasily Averin
as wrong and it was dropped in v2 version of patch set. > url: > https://github.com/0day-ci/linux/commits/Vasily-Averin/ext4-resize-long-lived-errors/20181029-235050 > base: https://git.kernel.org/cgit/linux/kernel/git/tytso/ext4.git dev > > in testcase: xfstests > wit

Re: [PATCH 2/2] mm: avoid unnecessary swap_info_struct allocation

2018-11-04 Thread Vasily Averin
On 11/5/18 3:57 AM, Huang, Ying wrote: > Vasily Averin writes: > >> Currently newly allocated swap_info_struct can be quickly freed. >> This patch avoid uneccessary high-order page allocation and helps >> to decrease the memory pressure. > > I think swapon/swap

Re: [PATCH 1/2] mm: use kvzalloc for swap_info_struct allocation

2018-11-04 Thread Vasily Averin
On 11/5/18 3:50 AM, Huang, Ying wrote: > Vasily Averin writes: > >> commit a2468cc9bfdf ("swap: choose swap device according to numa node") >> increased size of swap_info_struct up to 44 Kbytes, now it requires >> 4th order page. > > Why swap

[PATCH 2/2] mm: avoid unnecessary swap_info_struct allocation

2018-11-04 Thread Vasily Averin
Currently newly allocated swap_info_struct can be quickly freed. This patch avoid uneccessary high-order page allocation and helps to decrease the memory pressure. Signed-off-by: Vasily Averin --- mm/swapfile.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff

[PATCH 1/2] mm: use kvzalloc for swap_info_struct allocation

2018-11-04 Thread Vasily Averin
commit a2468cc9bfdf ("swap: choose swap device according to numa node") increased size of swap_info_struct up to 44 Kbytes, now it requires 4th order page. Switch to kvzmalloc allows to avoid unexpected allocation failures. Signed-off-by: Vasily Averin --- mm/swapfile.c | 6 +++-

[PATCH] ext4: missing !bh check in ext4_xattr_inode_write()

2018-11-04 Thread Vasily Averin
ext4_getblk() called with map_flags=0 can return NULL, it can lead to oops on bh dereferemce Fixes e50e5129f384 ("ext4: xattr-in-inode support") Cc: sta...@kernel.org # 4.13 Signed-off-by: Vasily Averin --- fs/ext4/xattr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/ext4

[PATCH] ext4: remove code duplication in update_ind/bind/tind_extent_range

2018-11-04 Thread Vasily Averin
update_ind/bind/tind_extent_page() differs by one variable and can be replaced by unified function. These functions are called by similar way and their caller function can be simplified too. Signed-off-by: Vasily Averin --- fs/ext4/migrate.c | 111

[PATCH 7/7] ext4: lost brelse in ext4_expand_extra_isize_ea()

2018-10-31 Thread Vasily Averin
Fixes de05ca852679 ("ext4: move call to ext4_error() into ...") # 4.17 Signed-off-by: Vasily Averin --- fs/ext4/xattr.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 5c9bc0d85cc0..0b9688683526 100644 --- a/fs/ex

[PATCH 5/7] ext4: bs.bh cleanup before re-using in ext4_xattr_block_find()

2018-10-31 Thread Vasily Averin
bs.bh was taken in previous ext4_xattr_block_find() call, it should be released before re-using Fixes 7e01c8e5420b ("ext3/4: fix uninitialized bs in ...") # 2.6.26 cc: Tiger Yang Signed-off-by: Vasily Averin --- fs/ext4/xattr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH 6/7] ext4: lost brelse in ext4_xattr_move_to_block()

2018-10-31 Thread Vasily Averin
Fixes 3f2571c1f91f ("ext4: factor out xattr moving") cc: Jan Kara however issue was present in original ext4_expand_extra_isize_ea() Fixes 6dd4ee7cab7e ("ext4: Expand extra_inodes space per ...") # 2.6.23 cc: Kalpak Shah Signed-off-by: Vasily Averin --- fs/ext4/xattr.c |

[PATCH 3/7] ext4: lost release of s_journal_flag_rwsem on rollback in ext4_fill_super

2018-10-31 Thread Vasily Averin
Fixes c8585c6fcaf2 ("ext4: fix races between changing inode journal ...") # 4.7 cc: Daeho Jeong Signed-off-by: Vasily Averin --- fs/ext4/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index ed4d36506ec2..0c9e165b4e3f 100644 --- a/fs/ex

[PATCH 4/7] ext4: lost brelse in ext4_xattr_get_block()

2018-10-31 Thread Vasily Averin
Fixes dec214d00e0d ("ext4: xattr inode deduplication") # 4.13 Signed-off-by: Vasily Averin --- fs/ext4/xattr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index dc1aeab06dba..07c3a115f7ae 100644 --- a/fs/ext4/xattr.c +++

[PATCH 0/7] ext4 long-lived issues, part two

2018-10-31 Thread Vasily Averin
I've found one more batch of long-lived ext4 issues, most of them are lost brelse + two leaks on rollback in ext4_fill_super. Oldest one was found in 2.6.23, last one -- in 4.18. Vasily Averin (7): ext4: lost brelse in __ext4_read_dirblock() ext4: possible sbi->s_group_desc

[PATCH 1/7] ext4: lost brelse in __ext4_read_dirblock()

2018-10-31 Thread Vasily Averin
Fixes dc6982ff4db1 ("ext4: refactor code to read directory blocks ...") # 3.9 Signed-off-by: Vasily Averin --- fs/ext4/namei.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index d388cce72db2..1a21e59ede72 100644 --- a/fs/ext4/namei.c +++

[PATCH 2/7] ext4: possible sbi->s_group_desc leak in ext4_fill_super

2018-10-31 Thread Vasily Averin
Fixes bfe0a5f47ada ("ext4: add more mount time checks of the superblock") # 4.18 Signed-off-by: Vasily Averin --- fs/ext4/super.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index a221f1cdf704..ed4d36506ec2 100644 --- a/fs/ex

Re: [PATCH v2 11/11] ext4: access to uninitialized bh fields in ext4_xattr_set_handle()

2018-10-30 Thread Vasily Averin
hey *are* initialized to zero.  I did not know it, I re-checked it in generated assembler code and found that you are right and I was wrong. Please drop this patch, should I resend of rest of this patch set once again? Thank you, Vasily Averin

[PATCH v2 10/11] ext4: remove useless brelse call in ext4_xattr_inode_update_ref()

2018-10-30 Thread Vasily Averin
brelse(iloc.bh) is useless here, it is always called with iloc.bh = NULL Fixes dec214d00e0d ("ext4: xattr inode deduplication") # 4.13 cc: Tahsin Erdogan Signed-off-by: Vasily Averin --- fs/ext4/xattr.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fs/ext4

[PATCH v2 11/11] ext4: access to uninitialized bh fields in ext4_xattr_set_handle()

2018-10-30 Thread Vasily Averin
can access uninitialized bh fields of on-stack located "is" and "bs" structures. Issue was inherited from ext3 and was present in first ext4 commit. Fixes ac27a0ec112a ("ext4: initial copy of files from ext3") # 2.6.19 Signed-off-by: Vasily Averin --- fs/ext4/xatt

[PATCH v2 08/11] ext4: lost brelse in ext4_orphan_add()

2018-10-30 Thread Vasily Averin
3617e579e0 ("ext4: Handle non empty on-disk orphan link") #2.6.34 cc: Dmitry Monakhov Signed-off-by: Vasily Averin --- fs/ext4/namei.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 67a38532032a..d388cce72db2 100644 --- a/f

[PATCH v2 09/11] ext4: iloc.bh cleanup in add_new_gdb()

2018-10-30 Thread Vasily Averin
iloc.bh was taken in ext4_reserve_inode_write() and released in ext4_mark_iloc_dirty(). It should not be released 2nd time in rollback after failed ext4_handle_dirty_metadata(gdb_bh) Fixes b40971426a83 ("ext4: add error checking to calls to ...") # 2.6.38 Signed-off-by: Vasily Averi

[PATCH v2 07/11] ext4: lost put_bh in ext4_mark_iloc_dirty()

2018-10-30 Thread Vasily Averin
ext4_mark_iloc_dirty() callers expect that it releases iloc->bh even if it returns an error. Fixes 0db1ff222d40 ("ext4: add shutdown bit and check for it") # 4.11 Signed-off-by: Vasily Averin --- fs/ext4/inode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --

[PATCH v2 03/11] ext4 resize: brelse() cleanup in add_new_gdb_meta_bg()

2018-10-30 Thread Vasily Averin
gdb_bh must be released in case of errors before update of s_group_desc but it must not be released after update of group descriptors because in this case bh can be used later. Fixes 01f795f9e0d6 ("ext4: add online resizing support for meta_bg ...") # 3.7 Signed-off-by: Vasily Averi

[PATCH v2 02/11] ext4 resize: missing brelse() after errors in set_flexbg_block_bitmap()

2018-10-30 Thread Vasily Averin
Fixes 33afdcc5402d ("ext4: add a function which sets up group blocks ...") # 3.3 Signed-off-by: Vasily Averin --- fs/ext4/resize.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index c3fa30878ca8..0a4dc6217e78 100644 ---

[PATCH v2 01/11] ext4 resise: extra brelse in setup_new_flex_group_blocks()

2018-10-30 Thread Vasily Averin
body of cycle to exclude requirement of brelse() call in rollback. Fixes 33afdcc5402d ("ext4: add a function which sets up group blocks ...") # 3.3+ Signed-off-by: Vasily Averin --- fs/ext4/resize.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/fs/ext4/res

[PATCH v2 05/11] ext4 resize: lost rollback in ext4_resize_fs()

2018-10-30 Thread Vasily Averin
Fixes 117fff10d7f1 ("ext4: grow the s_flex_groups array as needed ...") # 3.7 Signed-off-by: Vasily Averin --- fs/ext4/resize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index 3df326ee6d50..5fee65afd58b 100644 --- a/fs/ext

[PATCH v2 04/11] ext4 resize: lost brelse() in update_backups()

2018-10-30 Thread Vasily Averin
bh was not released after error in ext4_journal_get_write_access() Fixes ac27a0ec112a ("ext4: initial copy of files from ext3") # 2.6.19 Signed-off-by: Vasily Averin --- fs/ext4/resize.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/ext4/resize.c b/fs/ext

[PATCH v2 06/11] ext4 resize: lost resize_inode cleanup before retry in ext4_resize_fs()

2018-10-30 Thread Vasily Averin
Fixes 1c6bd7173d66 ("ext4: convert file system to meta_bg if needed ...") # 3.7 Signed-off-by: Vasily Averin --- fs/ext4/resize.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index 5fee65afd58b..85158e9de7c2 100644 --- a/fs/ext4/resize.

[PATCH v2 00/11] ext4: number of long lived errors

2018-10-30 Thread Vasily Averin
n body of the cycle to avoid having to call him on rollback. Other patches fixes visually-found mistakes. v2 changes: I've found error in one of v1 patches and fixed it, then I've found 4 additional issues, mostly related to iloc.bh accounting Vasily Averin (11): ext4 resise: extra

Re: [PATCH 3/7] ext4 resize: missing brelse() in case success in add_new_gdb()

2018-10-30 Thread Vasily Averin
please drop this one, it isn't correct. On 10/29/2018 06:25 PM, Vasily Averin wrote: > Fixes ac27a0ec112a ("ext4: initial copy of files from ext3") > #? cc: stable # 2.6.19 or evel earlier in ext3 > > Signed-off-by: Vasily Averin > --- > fs/ext4/re

[PATCH 4/7] ext4 resize: brelse() cleanup in add_new_gdb_meta_bg()

2018-10-29 Thread Vasily Averin
7+ Signed-off-by: Vasily Averin --- fs/ext4/resize.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index ff17480e8613..ff8389ac4769 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c @@ -923,6 +923,7 @@ static int add_new_gdb_meta

[PATCH 6/7] ext4 resize: lost rollback in ext4_resize_fs()

2018-10-29 Thread Vasily Averin
Fixes 117fff10d7f1 ("ext4: grow the s_flex_groups array as needed ...") #? cc: stable # 3.7+ Signed-off-by: Vasily Averin --- fs/ext4/resize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index 26bcb53e5869..16b7cfe48

[PATCH 1/7] ext4 resise: extra brelse in setup_new_flex_group_blocks()

2018-10-29 Thread Vasily Averin
body of cycle to exclude requirement of brelse() call in rollback. Fixes 33afdcc5402d ("ext4: add a function which sets up group blocks ...") #? cc: sta...@vger.kernel.org # 3.3+ Signed-off-by: Vasily Averin --- fs/ext4/resize.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletion

[PATCH 2/7] ext4 resize: missing brelse() after errors in set_flexbg_block_bitmap()

2018-10-29 Thread Vasily Averin
Fixes 33afdcc5402d ("ext4: add a function which sets up group blocks ...") #? cc: sta...@vger.kernel.org # 3.3+ Signed-off-by: Vasily Averin --- fs/ext4/resize.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index c3

[PATCH 7/7] ext4 resize: lost resize_inode cleanup before retry in ext4_resize_fs()

2018-10-29 Thread Vasily Averin
Fixes 1c6bd7173d66 ("ext4: convert file system to meta_bg if needed ...") #? cc: stable # 3.7+ Signed-off-by: Vasily Averin --- fs/ext4/resize.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index 16b7cfe485d7..3006ede18773 100644 ---

[PATCH 5/7] ext4 resize: lost brelse() in update_backups()

2018-10-29 Thread Vasily Averin
bh was not released after error in ext4_journal_get_write_access() Fixes ac27a0ec112a ("ext4: initial copy of files from ext3") #? cc: stable # 2.6.19 or even earlier in ext3 Signed-off-by: Vasily Averin --- fs/ext4/resize.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletio

[PATCH 0/7] ext4 resize long-lived errors

2018-10-29 Thread Vasily Averin
n body of the cycle to avoid having to call him on rollback. Other patches fixes visually-found mistakes. Vasily Averin (7): ext4 resise: extra brelse in setup_new_flex_group_blocks() ext4 resize: missing brelse() after errors in set_flexbg_block_bitmap() ext4 resize: missing brelse() in c

[PATCH 3/7] ext4 resize: missing brelse() in case success in add_new_gdb()

2018-10-29 Thread Vasily Averin
Fixes ac27a0ec112a ("ext4: initial copy of files from ext3") #? cc: stable # 2.6.19 or evel earlier in ext3 Signed-off-by: Vasily Averin --- fs/ext4/resize.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index 0a4dc6217e78..ff17480e8

[PATCH] lib/mpi: headers cleanup

2018-06-01 Thread Vasily Averin
itional ...") commit bc95eeadf5c6 ("lib/mpi: removed unused functions") however headers was not updated properly. Also I deleted some unused macros. cc: Dmitry Kasatkin Signed-off-by: Vasily Averin --- include/linux/mpi.h| 61 --

Re: [PATCH] netfilter: fix clusterip_net_exit build regression

2017-12-07 Thread Vasily Averin
thank you, it was mu fault. Reviewed-by: Vasily Averin On 2017-12-07 16:26, Arnd Bergmann wrote: > The added check produces a build error when CONFIG_PROC_FS is > disabled: > > net/ipv4/netfilter/ipt_CLUSTERIP.c: In function 'clusterip_net_exit': > net/ipv4/netfilt

[tip:perf/urgent] perf/core: Fix memory leak triggered by perf --namespace

2017-11-28 Thread tip-bot for Vasily Averin
Commit-ID: 0e18dd12064e07519f7cbff4149ca7fff620cbed Gitweb: https://git.kernel.org/tip/0e18dd12064e07519f7cbff4149ca7fff620cbed Author: Vasily Averin AuthorDate: Wed, 15 Nov 2017 08:47:02 +0300 Committer: Ingo Molnar CommitDate: Wed, 15 Nov 2017 09:47:27 +0100 perf/core: Fix memory

[tip:perf/urgent] perf/core: Fix memory leak triggered by perf --namespace

2017-11-15 Thread tip-bot for Vasily Averin
Commit-ID: 4a31b424ac0656d1bb17520ee861144fe7a19664 Gitweb: https://git.kernel.org/tip/4a31b424ac0656d1bb17520ee861144fe7a19664 Author: Vasily Averin AuthorDate: Wed, 15 Nov 2017 08:47:02 +0300 Committer: Ingo Molnar CommitDate: Wed, 15 Nov 2017 09:48:10 +0100 perf/core: Fix memory

Re: [PATCH] lost path_put in perf_fill_ns_link_info

2017-11-14 Thread Vasily Averin
On 2017-11-08 16:04, Vasily Averin wrote: > On 2017-11-08 15:09, Alexander Shishkin wrote: >> On Mon, Nov 06, 2017 at 09:22:18AM +0300, Vasily Averin wrote: >>> Fixes: commit e422267322cd ("perf: Add PERF_RECORD_NAMESPACES to include >>> namespaces related info&qu

[PATCH] memory leaks triggered by perf --namespace

2017-11-14 Thread Vasily Averin
does not allow to free unused namespace. Fixes: commit e422267322cd ("perf: Add PERF_RECORD_NAMESPACES to include namespaces related info") Signed-off-by: Vasily Averin --- kernel/events/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/events/core.c b/kernel/events/co

Re: [PATCH] lost path_put in perf_fill_ns_link_info

2017-11-08 Thread Vasily Averin
On 2017-11-08 15:09, Alexander Shishkin wrote: > On Mon, Nov 06, 2017 at 09:22:18AM +0300, Vasily Averin wrote: >> Fixes: commit e422267322cd ("perf: Add PERF_RECORD_NAMESPACES to include >> namespaces related info") >> Signed-off-by: Vasily Averin > > T

Re: [PATCH] lost path_put in perf_fill_ns_link_info

2017-11-05 Thread Vasily Averin
Dear Hari, I did not found where your patch decreases mnt counter, it seems for me you have lost path_put in perf_fill_ns_link_info(). Thank you, Vasily Averin On 2017-11-06 09:22, Vasily Averin wrote: > Fixes: commit e422267322cd ("perf: Add PERF_RECORD_NAMESPACES to

[PATCH] lost path_put in perf_fill_ns_link_info

2017-11-05 Thread Vasily Averin
Fixes: commit e422267322cd ("perf: Add PERF_RECORD_NAMESPACES to include namespaces related info") Signed-off-by: Vasily Averin --- kernel/events/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/events/core.c b/kernel/events/core.c index 10cdb9c..ab5ac84 100644 --

Re: [PATCH] nlm_shutdown_hosts_net() cleanup

2017-10-30 Thread Vasily Averin
On 2017-10-30 17:49, J. Bruce Fields wrote: > On Mon, Oct 30, 2017 at 04:47:58PM +0300, Vasily Averin wrote: >> nlm_complain_hosts() walk through nlm_server_hosts hlist that should be >> protected by nlm_host_mutex. > > I haven't looked at the NLM locking in ages.

[PATCH] lockd: fix lockd shutdown race with signal

2017-10-30 Thread Vasily Averin
nction that is called in all rollback cases and correctly removes lock_manager. The patch still resolves the problem fixed by reverted patch: now final final locks_end_grace() is called not before but after stop of lockd kernel thread. Fixes commit efda760fe95e ("lockd: fix lockd shutdown ra

Re: [RFC PATCH 0/2] race of lockd/nfsd inetaddr notifiers with pointers change

2017-10-30 Thread Vasily Averin
nal" Thank you, Vasily Averin On 2017-10-19 18:42, Vasily Averin wrote: > cc: Scott Mayhew > > Dear Scott, > could you please take look at patches? > > Let me describe the problem once again: > > lockd_inetaddr_event() > ... > if (nlmsvc_rqst)

  1   2   >