Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
fuse: fix lock annotations
fuse: flush background queue on connection close

+30 -20
+26 -16
fs/fuse/dev.c
··· 276 * Called with fc->lock, unlocks it 277 */ 278 static void request_end(struct fuse_conn *fc, struct fuse_req *req) 279 - __releases(&fc->lock) 280 { 281 void (*end) (struct fuse_conn *, struct fuse_req *) = req->end; 282 req->end = NULL; ··· 306 307 static void wait_answer_interruptible(struct fuse_conn *fc, 308 struct fuse_req *req) 309 - __releases(&fc->lock) 310 - __acquires(&fc->lock) 311 { 312 if (signal_pending(current)) 313 return; ··· 325 } 326 327 static void request_wait_answer(struct fuse_conn *fc, struct fuse_req *req) 328 - __releases(&fc->lock) 329 - __acquires(&fc->lock) 330 { 331 if (!fc->no_interrupt) { 332 /* Any signal may interrupt this */ ··· 905 906 /* Wait until a request is available on the pending list */ 907 static void request_wait(struct fuse_conn *fc) 908 - __releases(&fc->lock) 909 - __acquires(&fc->lock) 910 { 911 DECLARE_WAITQUEUE(wait, current); 912 ··· 934 */ 935 static int fuse_read_interrupt(struct fuse_conn *fc, struct fuse_copy_state *cs, 936 size_t nbytes, struct fuse_req *req) 937 - __releases(&fc->lock) 938 { 939 struct fuse_in_header ih; 940 struct fuse_interrupt_in arg; ··· 1720 * This function releases and reacquires fc->lock 1721 */ 1722 static void end_requests(struct fuse_conn *fc, struct list_head *head) 1723 - __releases(&fc->lock) 1724 - __acquires(&fc->lock) 1725 { 1726 while (!list_empty(head)) { 1727 struct fuse_req *req; ··· 1744 * locked). 1745 */ 1746 static void end_io_requests(struct fuse_conn *fc) 1747 - __releases(&fc->lock) 1748 - __acquires(&fc->lock) 1749 { 1750 while (!list_empty(&fc->io)) { 1751 struct fuse_req *req = ··· 1767 spin_lock(&fc->lock); 1768 } 1769 } 1770 } 1771 1772 /* ··· 1805 fc->connected = 0; 1806 fc->blocked = 0; 1807 end_io_requests(fc); 1808 - end_requests(fc, &fc->pending); 1809 - end_requests(fc, &fc->processing); 1810 wake_up_all(&fc->waitq); 1811 wake_up_all(&fc->blocked_waitq); 1812 kill_fasync(&fc->fasync, SIGIO, POLL_IN); ··· 1820 if (fc) { 1821 spin_lock(&fc->lock); 1822 fc->connected = 0; 1823 - end_requests(fc, &fc->pending); 1824 - end_requests(fc, &fc->processing); 1825 spin_unlock(&fc->lock); 1826 fuse_conn_put(fc); 1827 }
··· 276 * Called with fc->lock, unlocks it 277 */ 278 static void request_end(struct fuse_conn *fc, struct fuse_req *req) 279 + __releases(fc->lock) 280 { 281 void (*end) (struct fuse_conn *, struct fuse_req *) = req->end; 282 req->end = NULL; ··· 306 307 static void wait_answer_interruptible(struct fuse_conn *fc, 308 struct fuse_req *req) 309 + __releases(fc->lock) 310 + __acquires(fc->lock) 311 { 312 if (signal_pending(current)) 313 return; ··· 325 } 326 327 static void request_wait_answer(struct fuse_conn *fc, struct fuse_req *req) 328 + __releases(fc->lock) 329 + __acquires(fc->lock) 330 { 331 if (!fc->no_interrupt) { 332 /* Any signal may interrupt this */ ··· 905 906 /* Wait until a request is available on the pending list */ 907 static void request_wait(struct fuse_conn *fc) 908 + __releases(fc->lock) 909 + __acquires(fc->lock) 910 { 911 DECLARE_WAITQUEUE(wait, current); 912 ··· 934 */ 935 static int fuse_read_interrupt(struct fuse_conn *fc, struct fuse_copy_state *cs, 936 size_t nbytes, struct fuse_req *req) 937 + __releases(fc->lock) 938 { 939 struct fuse_in_header ih; 940 struct fuse_interrupt_in arg; ··· 1720 * This function releases and reacquires fc->lock 1721 */ 1722 static void end_requests(struct fuse_conn *fc, struct list_head *head) 1723 + __releases(fc->lock) 1724 + __acquires(fc->lock) 1725 { 1726 while (!list_empty(head)) { 1727 struct fuse_req *req; ··· 1744 * locked). 1745 */ 1746 static void end_io_requests(struct fuse_conn *fc) 1747 + __releases(fc->lock) 1748 + __acquires(fc->lock) 1749 { 1750 while (!list_empty(&fc->io)) { 1751 struct fuse_req *req = ··· 1767 spin_lock(&fc->lock); 1768 } 1769 } 1770 + } 1771 + 1772 + static void end_queued_requests(struct fuse_conn *fc) 1773 + __releases(fc->lock) 1774 + __acquires(fc->lock) 1775 + { 1776 + fc->max_background = UINT_MAX; 1777 + flush_bg_queue(fc); 1778 + end_requests(fc, &fc->pending); 1779 + end_requests(fc, &fc->processing); 1780 } 1781 1782 /* ··· 1795 fc->connected = 0; 1796 fc->blocked = 0; 1797 end_io_requests(fc); 1798 + end_queued_requests(fc); 1799 wake_up_all(&fc->waitq); 1800 wake_up_all(&fc->blocked_waitq); 1801 kill_fasync(&fc->fasync, SIGIO, POLL_IN); ··· 1811 if (fc) { 1812 spin_lock(&fc->lock); 1813 fc->connected = 0; 1814 + fc->blocked = 0; 1815 + end_queued_requests(fc); 1816 + wake_up_all(&fc->blocked_waitq); 1817 spin_unlock(&fc->lock); 1818 fuse_conn_put(fc); 1819 }
+4 -4
fs/fuse/file.c
··· 1144 1145 /* Called under fc->lock, may release and reacquire it */ 1146 static void fuse_send_writepage(struct fuse_conn *fc, struct fuse_req *req) 1147 - __releases(&fc->lock) 1148 - __acquires(&fc->lock) 1149 { 1150 struct fuse_inode *fi = get_fuse_inode(req->inode); 1151 loff_t size = i_size_read(req->inode); ··· 1183 * Called with fc->lock 1184 */ 1185 void fuse_flush_writepages(struct inode *inode) 1186 - __releases(&fc->lock) 1187 - __acquires(&fc->lock) 1188 { 1189 struct fuse_conn *fc = get_fuse_conn(inode); 1190 struct fuse_inode *fi = get_fuse_inode(inode);
··· 1144 1145 /* Called under fc->lock, may release and reacquire it */ 1146 static void fuse_send_writepage(struct fuse_conn *fc, struct fuse_req *req) 1147 + __releases(fc->lock) 1148 + __acquires(fc->lock) 1149 { 1150 struct fuse_inode *fi = get_fuse_inode(req->inode); 1151 loff_t size = i_size_read(req->inode); ··· 1183 * Called with fc->lock 1184 */ 1185 void fuse_flush_writepages(struct inode *inode) 1186 + __releases(fc->lock) 1187 + __acquires(fc->lock) 1188 { 1189 struct fuse_conn *fc = get_fuse_conn(inode); 1190 struct fuse_inode *fi = get_fuse_inode(inode);