User: | Jiri Slaby |
Error type: | Double Lock |
Error type description: | Some lock is locked twice unintentionally in a sequence |
File location: | fs/fuse/dev.c |
Line in file: | 747 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Clang Static Analyzer
(3.0)
Stanse (1.2) |
Entered: | 2012-04-17 12:29:30 UTC |
717 if (!err) 718 err = fuse_copy_one(&cs, &arg, sizeof(arg)); 719 fuse_copy_finish(&cs); 720 721 return err ? err : reqsize; 722} 723 724/* 725 * Read a single request into the userspace filesystem's buffer. This 726 * function waits until a request is available, then removes it from 727 * the pending list and copies request data to userspace buffer. If 728 * no reply is needed (FORGET) or request has been aborted or there 729 * was an error during the copying then it's finished by calling 730 * request_end(). Otherwise add it to the processing list, and set 731 * the 'sent' flag. 732 */ 733static ssize_t fuse_dev_read(struct kiocb *iocb, const struct iovec *iov, 734 unsigned long nr_segs, loff_t pos) 735{ 736 int err; 737 struct fuse_req *req; 738 struct fuse_in *in; 739 struct fuse_copy_state cs; 740 unsigned reqsize; 741 struct file *file = iocb->ki_filp; 742 struct fuse_conn *fc = fuse_get_conn(file); 743 if (!fc) 744 return -EPERM; 745 746 restart: 747 spin_lock(&fc->lock); 748 err = -EAGAIN; 749 if ((file->f_flags & O_NONBLOCK) && fc->connected && 750 !request_pending(fc)) 751 goto err_unlock; 752 753 request_wait(fc); 754 err = -ENODEV; 755 if (!fc->connected) 756 goto err_unlock; 757 err = -ERESTARTSYS;