Re: [dm-devel] regression: data corruption with ext4 on LUKS on nvme with torvalds master

2021-05-14 Thread Mikulas Patocka
On Thu, 13 May 2021, Bart Van Assche wrote: > On 5/13/21 12:22 PM, Mikulas Patocka wrote: > > We already had problems with too large bios in dm-crypt and we fixed it by > > adding this piece of code: > > > > /* > > * Check if bio is too large, split as needed. > > */

Re: [dm-devel] regression: data corruption with ext4 on LUKS on nvme with torvalds master

2021-05-14 Thread Mikulas Patocka
On 5/13/21 7:15 AM, Theodore Ts'o wrote: > On Thu, May 13, 2021 at 06:42:22PM +0900, Changheun Lee wrote: >> >> Problem might be casued by exhausting of memory. And memory exhausting >> would be caused by setting of small bio_max_size. Actually it was not >> reproduced in my VM environment at fi

Re: [dm-devel] [PATCH v2 6/6] multipathd: use symbolic returns for ev_remove_path()

2021-05-14 Thread Benjamin Marzinski
On Thu, May 13, 2021 at 08:11:13PM +, Martin Wilck wrote: > On Thu, 2021-05-13 at 12:23 -0500, Benjamin Marzinski wrote: > > There are many possible outcomes of calling ev_remove_path(), and not > > all callers agree on which outcomes are a success and which are a > > failure. So ev_remove_path

Re: [dm-devel] [PATCH v2] multipathd: fix compilation issue with liburcu < 0.8

2021-05-14 Thread Benjamin Marzinski
On Thu, May 13, 2021 at 09:53:58PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > To avoid race conditions with pending RCU callbacks on exit, it's > necessary to call rcu_barrier() in cleanup_rcu() (see > https://lists.lttng.org/pipermail/lttng-dev/2021-May/029958.html and > follow-ups).

[dm-devel] [PATCH v3 5/6] kpartx: Don't leak memory when getblock returns NULL

2021-05-14 Thread Benjamin Marzinski
If a new block was allocated, but couldn't be filled, getblock will discard it. When it does so, it needs to free the block to avoid leaking memory. Found by coverity. Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- kpartx/kpartx.c | 2 ++ 1 file changed, 2 insertions(+) diff -

[dm-devel] [PATCH v3 0/6] Memory issues found by coverity

2021-05-14 Thread Benjamin Marzinski
This is collection of issues found by coverity. The first three patches deal with ev_remove_path() removing the path, but returning failure, causing a use-after-free error. The next two patches fix memory leaks. The final patch removes an unnecessary call to rescan_paths() from uev_update_path() C

[dm-devel] [PATCH v3 2/6] multipathd: remove duplicate orphan_paths in flush_map

2021-05-14 Thread Benjamin Marzinski
remove_map_and_stop_waiter() already calls orphan_paths() so flush_map() doesn't need to call orphan_paths() before calling remove_map_and_stop_waiter(). Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- multipathd/main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/multipat

[dm-devel] [PATCH v3 6/6] multipathd: don't rescan_path on wwid change in uev_update_path

2021-05-14 Thread Benjamin Marzinski
If get_uid() is returning a different wwid in uev_update_path(), then the uid_attribute must have already gotten updated, which was the purpose behind calling rescan_path() in the first place. Signed-off-by: Benjamin Marzinski --- multipathd/main.c | 1 - 1 file changed, 1 deletion(-) diff --gi

[dm-devel] [PATCH v3 4/6] multipath: free vectors in configure

2021-05-14 Thread Benjamin Marzinski
configure() can retry multiple times, each time reallocing a maps and paths vector, and leaking the previous ones. Fix this by always freeing the vectors before configure() exits. Found by coverity. Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- multipath/main.c | 7 ++- 1

[dm-devel] [PATCH v3 3/6] multipathd: fix ev_remove_path return code handling

2021-05-14 Thread Benjamin Marzinski
When ev_remove_path() returned success, callers assumed that the path (and possibly the map) had been removed. When ev_remove_path() returned failure, callers assumed that the path had not been removed. However, the path could be removed on both success or failure. This could cause callers to dere

[dm-devel] [PATCH v3 1/6] multipathd: don't fail to remove path once the map is removed

2021-05-14 Thread Benjamin Marzinski
In ev_remove_path(), if update_mpp_paths() fails, we delete the entire map. However, since update_mpp_paths() happens before we call set_path_removed(), pp->initialized isn't set to INIT_REMOVED, so remove_map_and_stop_waiter() doesn't remove the path when in removes the map. But with the map remo

Re: [dm-devel] [PATCH v3 6/6] multipathd: don't rescan_path on wwid change in uev_update_path

2021-05-14 Thread Martin Wilck
On Fri, 2021-05-14 at 15:11 -0500, Benjamin Marzinski wrote: > If get_uid() is returning a different wwid in uev_update_path(), then > the uid_attribute must have already gotten updated, which was the > purpose behind calling rescan_path() in the first place. > > Signed-off-by: Benjamin Marzinski

Re: [dm-devel] [PATCH v3 3/6] multipathd: fix ev_remove_path return code handling

2021-05-14 Thread Martin Wilck
On Fri, 2021-05-14 at 15:10 -0500, Benjamin Marzinski wrote: > When ev_remove_path() returned success, callers assumed that the path > (and possibly the map) had been removed.  When ev_remove_path() > returned > failure, callers assumed that the path had not been removed. However, > the path could