xfs
[Top] [All Lists]

Re: [PATCH 1/1] xfs: fix buffer flushing during log unmount

To: Amit Sahrawat <amit.sahrawat83@xxxxxxxxx>
Subject: Re: [PATCH 1/1] xfs: fix buffer flushing during log unmount
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Fri, 17 Feb 2012 14:15:23 -0500
Cc: Ben Myers <bpm@xxxxxxx>, Alex Elder <elder@xxxxxxxxxx>, Christoph Hellwig <hch@xxxxxxxxxxxxx>, Dave Chinner <david@xxxxxxxxxxxxx>, xfs-masters@xxxxxxxxxxx, xfs@xxxxxxxxxxx, Nam-Jae Jeon <linkinjeon@xxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx
In-reply-to: <1329306980-17997-1-git-send-email-amit.sahrawat83@xxxxxxxxx>
References: <1329306980-17997-1-git-send-email-amit.sahrawat83@xxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
> 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?

<Prev in Thread] Current Thread [Next in Thread>