linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* the qemu-nbd process automatically exit with the commit 43347d56c 'livepatch: send a fake signal to all blocking tasks'
@ 2021-04-14  3:55 xiaojun.zhao141
  2021-04-14 11:27 ` Miroslav Benes
  0 siblings, 1 reply; 7+ messages in thread
From: xiaojun.zhao141 @ 2021-04-14  3:55 UTC (permalink / raw)
  To: mbenes; +Cc: josef, linux-kernel

I found the qemu-nbd process(started with qemu-nbd -t -c /dev/nbd0
nbd.qcow2) will automatically exit when I patched for functions of
the nbd with livepatch.

The nbd relative source:
static int nbd_start_device_ioctl(struct nbd_device *nbd, struct block_device *bdev)
{                                                                               
        struct nbd_config *config = nbd->config;                                
        int ret;                                                                
                                                                                
        ret = nbd_start_device(nbd);                                            
        if (ret)                                                                
                return ret;                                                     
                                                                                
        if (max_part)                                                           
                bdev->bd_invalidated = 1;                                       
        mutex_unlock(&nbd->config_lock);                                        
        ret = wait_event_interruptible(config->recv_wq,                         
                                         atomic_read(&config->recv_threads) == 0);
        if (ret)                                                                
                sock_shutdown(nbd);                                             
        flush_workqueue(nbd->recv_workq);                                       
                                                                                
        mutex_lock(&nbd->config_lock);                                          
        nbd_bdev_reset(bdev);                                                   
        /* user requested, ignore socket errors */                              
        if (test_bit(NBD_RT_DISCONNECT_REQUESTED, &config->runtime_flags))      
                ret = 0;                                                        
        if (test_bit(NBD_RT_TIMEDOUT, &config->runtime_flags))                  
                ret = -ETIMEDOUT;                                               
        return ret;                                                             
}

When the nbd waits for atomic_read(&config->recv_threads) == 0, the klp
will send a fake signal to it then the qemu-nbd process exits. And the
signal of sysfs to control this action was removed in the commit
10b3d52790e 'livepatch: Remove signal sysfs attribute'. Are there other
ways to control this action? How?

Thanks very much.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-04-15  8:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-14  3:55 the qemu-nbd process automatically exit with the commit 43347d56c 'livepatch: send a fake signal to all blocking tasks' xiaojun.zhao141
2021-04-14 11:27 ` Miroslav Benes
2021-04-14 14:52   ` xiaojun.zhao141
2021-04-14 15:21   ` xiaojun.zhao141
2021-04-14 17:21     ` Josef Bacik
2021-04-15  6:27       ` xiaojun.zhao141
2021-04-15  8:37       ` Miroslav Benes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).