Re: [Nbd] [PATCH 3/3]nbd: make nbd device wait for its users

2016-06-24 Thread Eric Blake
On 06/24/2016 04:09 AM, Pranay Kr. Srivastava wrote: > When a timeout occurs or a recv fails, then > instead of abruplty killing nbd block device s/abruplty/abruptly/ > wait for it's users to finish. s/it's/its/ > > This is more required when filesystem(s) like > ext2 or ext3 don't expect thei

Re: [Nbd] [PATCH 1/2] nbd: make nbd device wait for its users

2016-06-24 Thread Eric Blake
On 06/24/2016 03:29 AM, Markus Pargmann wrote: > From: "Pranay Kr. Srivastava" > > When a timeout occurs or a recv fails, then instead of abruplty killing s/abruplty/abruptly/ > nbd block device wait for it's users to finish. s/it's/its/ (remember, "it's" is only usable where "it is" would als

[Nbd] [PATCH v3 1/3]nbd: fix might_sleep warning on socket shutdown

2016-06-24 Thread Pranay Kr. Srivastava
spinlocked ranges should be small and not contain calls into huge subfunctions. Fix my mistake and just get the pointer to the socket instead of doing everything with spinlock held. Reported-by: Mikulas Patocka Signed-off-by: Markus Pargmann Changelog: Pranay Kr. Srivastava: 1) Use spin_lock i

[Nbd] [PATCH v3 2/3]nbd: cleanup nbd_set_socket

2016-06-24 Thread Pranay Kr. Srivastava
This patch 1) uses spin_lock instead of irq version. 2) removes the goto statement in case a socket is already assigned with simple if-else statement. Signed-off-by: Pranay Kr. Srivastava --- drivers/block/nbd.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --g

[Nbd] [PATCH v3 0/3] nbd: resolve bugs and limitations

2016-06-24 Thread Pranay Kr. Srivastava
This patch series fixes the following 1) fix might_sleep warning on socket shutdown: Fix sock_shutdown to avoid calling kernel_sock_shutdown while holding spin_lock. 2) cleanup nbd_set_socket Simple fixes to nbd_set_socket. 3) make nbd device wait for its users. When a timeout or er

[Nbd] [PATCH 3/3]nbd: make nbd device wait for its users

2016-06-24 Thread Pranay Kr. Srivastava
When a timeout occurs or a recv fails, then instead of abruplty killing nbd block device wait for it's users to finish. This is more required when filesystem(s) like ext2 or ext3 don't expect their buffer heads to disappear while the filesystem is mounted. Each open of a nbd device is refcounted,

Re: [Nbd] [PATCH 1/2] nbd: make nbd device wait for its users

2016-06-24 Thread Pranay Srivastava
Hey Markus, On Fri, Jun 24, 2016 at 2:59 PM, Markus Pargmann wrote: > From: "Pranay Kr. Srivastava" > > When a timeout occurs or a recv fails, then instead of abruplty killing > nbd block device wait for it's users to finish. > > This is more required when filesystem(s) like ext2 or ext3 don't e

[Nbd] [PATCH 1/2] nbd: make nbd device wait for its users

2016-06-24 Thread Markus Pargmann
From: "Pranay Kr. Srivastava" When a timeout occurs or a recv fails, then instead of abruplty killing nbd block device wait for it's users to finish. This is more required when filesystem(s) like ext2 or ext3 don't expect their buffer heads to disappear while the filesystem is mounted. Each ope

[Nbd] [PATCH 2/2] nbd: Disallow ioctls on disconnected block device

2016-06-24 Thread Markus Pargmann
After NBD_DO_IT exited the block device may still be used. Make sure that we handle intended disconnects differently and do not allow any changed of the nbd device. This patch should avoid that the nbd-client connects to a different server and the users of the block device are suddenly reading/wri