Showing error 1182

User: Jiri Slaby
Error type: Double Unlock
Error type description: Some lock is unlocked twice unintentionally in a sequence
File location: drivers/block/nbd.c
Line in file: 134
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-04-30 10:52:00 UTC


Source:

104{
105        int error = req->errors ? -EIO : 0;
106        struct request_queue *q = req->q;
107        unsigned long flags;
108
109        dprintk(DBG_BLKDEV, "%s: request %p: %s\n", req->rq_disk->disk_name,
110                        req, error ? "failed" : "done");
111
112        spin_lock_irqsave(q->queue_lock, flags);
113        __blk_end_request(req, error, req->nr_sectors << 9);
114        spin_unlock_irqrestore(q->queue_lock, flags);
115}
116
117static void sock_shutdown(struct nbd_device *lo, int lock)
118{
119        /* Forcibly shutdown the socket causing all listeners
120         * to error
121         *
122         * FIXME: This code is duplicated from sys_shutdown, but
123         * there should be a more generic interface rather than
124         * calling socket ops directly here */
125        if (lock)
126                mutex_lock(&lo->tx_lock);
127        if (lo->sock) {
128                printk(KERN_WARNING "%s: shutting down socket\n",
129                        lo->disk->disk_name);
130                kernel_sock_shutdown(lo->sock, SHUT_RDWR);
131                lo->sock = NULL;
132        }
133        if (lock)
134                mutex_unlock(&lo->tx_lock);
135}
136
137static void nbd_xmit_timeout(unsigned long arg)
138{
139        struct task_struct *task = (struct task_struct *)arg;
140
141        printk(KERN_WARNING "nbd: killing hung xmit (%s, pid: %d)\n",
142                task->comm, task->pid);
143        force_sig(SIGKILL, task);
144}
Show full sources