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=unavailable 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 q1HJFS9t103769 for ; Fri, 17 Feb 2012 13:15:29 -0600 X-ASG-Debug-ID: 1329506126-04bdf002ce69600001-7TOuyN Received: from bombadil.infradead.org (173-166-109-252-newengland.hfc.comcastbusiness.net [173.166.109.252]) by cuda.sgi.com with ESMTP id avSQCD0RnHydriPH (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO); Fri, 17 Feb 2012 11:15:27 -0800 (PST) X-Barracuda-Envelope-From: BATV+630a4b851243e3b20166+3099+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 173.166.109.252 Received: from hch by bombadil.infradead.org with local (Exim 4.76 #1 (Red Hat Linux)) id 1RyTH9-0004aI-1l; Fri, 17 Feb 2012 19:15:23 +0000 Date: Fri, 17 Feb 2012 14:15:23 -0500 From: Christoph Hellwig To: Amit Sahrawat Cc: Ben Myers , Alex Elder , Christoph Hellwig , Dave Chinner , xfs-masters@oss.sgi.com, xfs@oss.sgi.com, Nam-Jae Jeon , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] xfs: fix buffer flushing during log unmount Message-ID: <20120217191522.GB13870@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 1/1] xfs: fix buffer flushing during log unmount References: <1329306980-17997-1-git-send-email-amit.sahrawat83@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1329306980-17997-1-git-send-email-amit.sahrawat83@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: 173-166-109-252-newengland.hfc.comcastbusiness.net[173.166.109.252] X-Barracuda-Start-Time: 1329506127 X-Barracuda-Encrypted: AES256-SHA X-Barracuda-URL: http://192.48.157.11:80/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=1.3 tests=RDNS_DYNAMIC X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.88780 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_DYNAMIC Delivered to trusted network by host with dynamic-looking rDNS > Whenever there is a mount/unmount failure - there is a chance of calling the > callbacks functions once - transaction ail mount pointer is destroyed. So, it results > in NULL pointer exception followed by hang. So, before unmount of the log - flush all > the pending buffers. > void > xfs_log_unmount(xfs_mount_t *mp) > { > + int error = 0; > + /* > + * Make sure all buffers have been flushed and completed before > + * unmounting the log. > + */ > + error = xfs_flush_buftarg(mp->m_ddev_targp, 1); > + if (error) > + cmn_err(CE_WARN, "%d busy buffers during log unmount.", error); > + xfs_wait_buftarg(mp->m_ddev_targp); > + We do exactly that sequence before the xfs_log_unmount_write call on umount. Care to explain what code in xfs_log_unmount_write would require this to be called again?