[RFC PATCH] memalloc_noio: update the comment to make it cleaner

2019-09-17 Thread xiubli
From: Xiubo Li The GFP_NOIO means all further allocations will implicitly drop both __GFP_IO and __GFP_FS flags and so they are safe for both the IO critical section and the the critical section from the allocation recursion point of view. Not only the __GFP_IO, which a bit confusing when reading

[PATCH v2] nbd: fix possible page fault for nbd disk

2019-08-21 Thread xiubli
From: Xiubo Li When the NBD_CFLAG_DESTROY_ON_DISCONNECT flag is set and at the same time when the socket is closed due to the server daemon is restarted, just before the last DISCONNET is totally done if we start a new connection by using the old nbd_index, there will be crashing randomly, like:

[PATCH] nbd: no need to check all the connections one by one if all are dead

2019-05-30 Thread xiubli
From: Xiubo Li If all connections are dead the live_connections should be already set to 0. And set the nsock->fallback to -1 again if all connections are dead. Signed-off-by: Xiubo Li --- drivers/block/nbd.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff

[PATCH] Revert "uio: use request_threaded_irq instead"

2018-08-12 Thread xiubli
From: Xiubo Li Since mutex lock in irq hanler is useless currently, here will remove it together with it. This reverts commit 9421e45f5ff3d558cf8b75a8cc0824530caf3453. Reported-by: james.r.har...@intel.com CC: Ahsan Atta Signed-off-by: Xiubo Li --- drivers/uio/uio.c | 8 ++-- 1 file chan

[PATCH] uio: fix possible circular locking dependency

2018-07-30 Thread xiubli
From: Xiubo Li The call trace: XXX/1910 is trying to acquire lock: (&mm->mmap_sem){++}, at: [] might_fault+0x57/0xb0 but task is already holding lock: (&idev->info_lock){+.+...}, at: [] uio_write+0x46/0x130 [uio] which lock already depends on the new lock. the existing dependency chain (

[PATCH v4 1/3] uio: use request_threaded_irq instead

2018-07-06 Thread xiubli
From: Xiubo Li Prepraing for changing to use mutex lock. Signed-off-by: Xiubo Li --- drivers/uio/uio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index e8f4ac9..b4b2ae1 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c @@

[PATCH v4 2/3] uio: change to use the mutex lock instead of the spin lock

2018-07-06 Thread xiubli
From: Xiubo Li We are hitting a regression with the following commit: commit a93e7b331568227500186a465fee3c2cb5dffd1f Author: Hamish Martin Date: Mon May 14 13:32:23 2018 +1200 uio: Prevent device destruction while fds are open The problem is the addition of spin_lock_irqsave in uio_wri

[PATCH v4 3/3] uio: fix crash after the device is unregistered

2018-07-06 Thread xiubli
From: Xiubo Li For the target_core_user use case, after the device is unregistered it maybe still opened in user space, then the kernel will crash, like: [ 251.163692] BUG: unable to handle kernel NULL pointer dereference at 0008 [ 251.163820] IP: [] show_name+0x23/0x40 [uio] [ 2

[PATCH v4 0/3] uio: fix potential crash bug

2018-07-06 Thread xiubli
From: Xiubo Li V2: - resend it with some small fix V3: - switch to use request_threaded_irq V4: - remove useless checking code, Thanks Mike. - Thanks very much for the review from Hamish and Mike. Xiubo Li (3): uio: use request_threaded_irq instead uio: change to use the mutex lock instea

[PATCH v3 1/3] uio: use request_threaded_irq instead

2018-07-05 Thread xiubli
From: Xiubo Li Prepraing for changing to use mutex lock. Signed-off-by: Xiubo Li --- drivers/uio/uio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index e8f4ac9..b4b2ae1 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c @@

[PATCH v3 0/3] uio: fix potential crash bug

2018-07-05 Thread xiubli
From: Xiubo Li The V2 patch set maybe not post successfully, so post it again with one new updation. V2: - resend it with some small fix V3: - switch to use request_threaded_irq Xiubo Li (3): uio: use request_threaded_irq instead uio: change to use the mutex lock instead of the spin lock

[PATCH v3 2/3] uio: change to use the mutex lock instead of the spin lock

2018-07-05 Thread xiubli
From: Xiubo Li We are hitting a regression with the following commit: commit a93e7b331568227500186a465fee3c2cb5dffd1f Author: Hamish Martin Date: Mon May 14 13:32:23 2018 +1200 uio: Prevent device destruction while fds are open The problem is the addition of spin_lock_irqsave in uio_wri

[PATCH v3 3/3] uio: fix crash after the device is unregistered

2018-07-05 Thread xiubli
From: Xiubo Li For the target_core_user use case, after the device is unregistered it maybe still opened in user space, then the kernel will crash, like: [ 251.163692] BUG: unable to handle kernel NULL pointer dereference at 0008 [ 251.163820] IP: [] show_name+0x23/0x40 [uio] [ 2

[PATCH V2 1/2] uio: change to use the mutex lock instead of the spin lock

2018-07-05 Thread xiubli
From: Xiubo Li We are hitting a regression with the following commit: commit a93e7b331568227500186a465fee3c2cb5dffd1f Author: Hamish Martin Date: Mon May 14 13:32:23 2018 +1200 uio: Prevent device destruction while fds are open The problem is the addition of spin_lock_irqsave in uio_wri

[PATCH V2 0/2] uio: fix potential crash bug

2018-07-05 Thread xiubli
From: Xiubo Li V2: - resend it with some small fix Xiubo Li (2): uio: change to use the mutex lock instead of the spin lock uio: fix crash after the device is unregistered drivers/uio/uio.c | 142 ++--- include/linux/uio_driver.h | 2 +- 2

[PATCH V2 2/2] uio: fix crash after the device is unregistered

2018-07-05 Thread xiubli
From: Xiubo Li For the target_core_user use case, after the device is unregistered it maybe still opened in user space, then the kernel will crash, like: [ 251.163692] BUG: unable to handle kernel NULL pointer dereference at 0008 [ 251.163820] IP: [] show_name+0x23/0x40 [uio] [ 2

[PATCH 1/2] uio: change to use the mutex lock instead of the spin lock

2018-07-05 Thread xiubli
From: Xiubo Li We are hitting a regression with the following commit: commit a93e7b331568227500186a465fee3c2cb5dffd1f Author: Hamish Martin Date: Mon May 14 13:32:23 2018 +1200 uio: Prevent device destruction while fds are open The problem is the addition of spin_lock_irqsave in uio_wri

[PATCH 2/2] uio: fix crash after the device is unregistered

2018-07-05 Thread xiubli
From: Xiubo Li For the target_core_user use case, after the device is unregistered it maybe still opened in user space, then the kernel will crash, like: [ 251.163692] BUG: unable to handle kernel NULL pointer dereference at 0008 [ 251.163820] IP: [] show_name+0x23/0x40 [uio] [ 2

[PATCH 0/2] uio: fix potential crash bug

2018-07-05 Thread xiubli
From: Xiubo Li Xiubo Li (2): uio: change to use the mutex lock instead of the spin lock uio: fix crash after the device is unregistered drivers/uio/uio.c | 134 + include/linux/uio_driver.h | 2 +- 2 files changed, 101 insertions(+),