X-Spam-Checker-Version: SpamAssassin 3.4.0-r929098 (2010-03-30) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.4.0-r929098 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id p786jtpN019872 for ; Mon, 8 Aug 2011 01:45:55 -0500 X-ASG-Debug-ID: 1312786029-7d6501420000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5E49716906CE for ; Sun, 7 Aug 2011 23:47:09 -0700 (PDT) Received: from ipmail04.adl6.internode.on.net (ipmail04.adl6.internode.on.net [150.101.137.141]) by cuda.sgi.com with ESMTP id 1hemMlZCf3AiXalL for ; Sun, 07 Aug 2011 23:47:09 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtYHACWEP055LbAB/2dsb2JhbABCmDGPBniBbi8jGIECA8QLhkYEmziIRA Received: from ppp121-45-176-1.lns20.syd7.internode.on.net (HELO dastard) ([121.45.176.1]) by ipmail04.adl6.internode.on.net with ESMTP; 08 Aug 2011 16:15:53 +0930 Received: from chute ([192.168.1.1] helo=disappointment) by dastard with esmtp (Exim 4.76) (envelope-from ) id 1QqJan-00027k-UD; Mon, 08 Aug 2011 16:45:41 +1000 Received: from dave by disappointment with local (Exim 4.76) (envelope-from ) id 1QqJad-0002mv-Lo; Mon, 08 Aug 2011 16:45:31 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: linux-fsdevel@vger.kernel.org X-ASG-Orig-Subj: [PATCH 0/2] splice: i_mutex vs splice write deadlock V2 Subject: [PATCH 0/2] splice: i_mutex vs splice write deadlock V2 Date: Mon, 8 Aug 2011 16:45:25 +1000 Message-Id: <1312785927-10662-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.7.5.4 X-Barracuda-Connect: ipmail04.adl6.internode.on.net[150.101.137.141] X-Barracuda-Start-Time: 1312786030 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0108 1.0000 -1.9507 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.95 X-Barracuda-Spam-Status: No, SCORE=-1.95 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.71176 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean generic_file_splice_write() takes the inode->i_mutex after the filesystem has taken whatever locks it needs to ensure sanity. however, this typically violates the locking order of filesystems with their own locks in that the order is usually i_mutex -> filesystem lock. XFS is such a case, and generic_file_splice_write() is generating lockdep warnings because of lock inversions between the inode->i_mutex and the XFS_I(inode)->i_iolock. There is also a reported case of fio causing a deadlock when it mixes IO types (e.g. splice vs direct IO). Version 2: - add a new function to take an actor to do the work of splicing the data to the file. Convert generic_file_splice_write to use this, and make XFS call it with a different actor fuction that avoids the i_mutex.