Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1461765 > unrolled thread

Re: [PATCH 3.16 102/305] xfs: xfs_iflush_cluster fails to abort on error

Started byDave Chinner <david@fromorbit.com>
First post2016-08-14 12:20 +0200
Last post2016-08-17 04:10 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 3.16 102/305] xfs: xfs_iflush_cluster fails to abort on  error Dave Chinner <david@fromorbit.com> - 2016-08-14 12:20 +0200
    Re: [PATCH 3.16 102/305] xfs: xfs_iflush_cluster fails to abort on  error Ben Hutchings <ben@decadent.org.uk> - 2016-08-16 21:50 +0200
      Re: [PATCH 3.16 102/305] xfs: xfs_iflush_cluster fails to abort on  error Dave Chinner <dchinner@redhat.com> - 2016-08-17 04:10 +0200

#1461765 — Re: [PATCH 3.16 102/305] xfs: xfs_iflush_cluster fails to abort on error

FromDave Chinner <david@fromorbit.com>
Date2016-08-14 12:20 +0200
SubjectRe: [PATCH 3.16 102/305] xfs: xfs_iflush_cluster fails to abort on error
Message-ID<s60Gl-6CJ-1@gated-at.bofh.it>
On Sat, Aug 13, 2016 at 06:42:51PM +0100, Ben Hutchings wrote:
> 3.16.37-rc1 review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Dave Chinner <dchinner@redhat.com>
> 
> commit b1438f477934f5a4d5a44df26f3079a7575d5946 upstream.
> 
> When a failure due to an inode buffer occurs, the error handling
> fails to abort the inode writeback correctly. This can result in the
> inode being reclaimed whilst still in the AIL, leading to
> use-after-free situations as well as filesystems that cannot be
> unmounted as the inode log items left in the AIL never get removed.
> 
> Fix this by ensuring fatal errors from xfs_imap_to_bp() result in
> the inode flush being aborted correctly.
....
>  
>  	/*
> -	 * Get the buffer containing the on-disk inode.
> +	 * Get the buffer containing the on-disk inode. We are doing a try-lock
> +	 * operation here, so we may get  an EAGAIN error. In that case, we
> +	 * simply want to return with the inode still dirty.
> +	 *
> +	 * If we get any other error, we effectively have a corruption situation
> +	 * and we cannot flush the inode, so we treat it the same as failing
> +	 * xfs_iflush_int().
>  	 */
>  	error = xfs_imap_to_bp(mp, NULL, &ip->i_imap, &dip, &bp, XBF_TRYLOCK,
>  			       0);
> -	if (error || !bp) {
> +	if (error == -EAGAIN) {

Wrong. As was pointed out for other -stable trees after users
reported regressions, the error signs in XFS changed from positive
to negative in 3.17-rc1.

-Dave.
-- 
Dave Chinner
david@fromorbit.com

[toc] | [next] | [standalone]


#1464031

FromBen Hutchings <ben@decadent.org.uk>
Date2016-08-16 21:50 +0200
Message-ID<s6Sx4-7iI-21@gated-at.bofh.it>
In reply to#1461765

[Multipart message — attachments visible in raw view] — view raw

On Sun, 2016-08-14 at 09:36 +1000, Dave Chinner wrote:
> On Sat, Aug 13, 2016 at 06:42:51PM +0100, Ben Hutchings wrote:
> > 
> > 3.16.37-rc1 review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > > > From: Dave Chinner <dchinner@redhat.com>
> > 
> > commit b1438f477934f5a4d5a44df26f3079a7575d5946 upstream.
> > 
> > When a failure due to an inode buffer occurs, the error handling
> > fails to abort the inode writeback correctly. This can result in the
> > inode being reclaimed whilst still in the AIL, leading to
> > use-after-free situations as well as filesystems that cannot be
> > unmounted as the inode log items left in the AIL never get removed.
> > 
> > Fix this by ensuring fatal errors from xfs_imap_to_bp() result in
> > the inode flush being aborted correctly.
> ....
> > 
> >  
> > > >  	/*
> > > > -	 * Get the buffer containing the on-disk inode.
> > > > +	 * Get the buffer containing the on-disk inode. We are doing a try-lock
> > > > +	 * operation here, so we may get  an EAGAIN error. In that case, we
> > > > +	 * simply want to return with the inode still dirty.
> > > > +	 *
> > > > +	 * If we get any other error, we effectively have a corruption situation
> > > > +	 * and we cannot flush the inode, so we treat it the same as failing
> > > > +	 * xfs_iflush_int().
> > > >  	 */
> > > >  	error = xfs_imap_to_bp(mp, NULL, &ip->i_imap, &dip, &bp, XBF_TRYLOCK,
> > > >  			       0);
> > > > -	if (error || !bp) {
> > > > +	if (error == -EAGAIN) {
> 
> Wrong. As was pointed out for other -stable trees after users
> reported regressions, the error signs in XFS changed from positive
> to negative in 3.17-rc1.

OK, so do I just need to delete the minus sign there?

Ben.

-- 
Ben Hutchings
If at first you don't succeed, you're doing about average.

[toc] | [prev] | [next] | [standalone]


#1464285

FromDave Chinner <dchinner@redhat.com>
Date2016-08-17 04:10 +0200
Message-ID<s6YsO-2US-11@gated-at.bofh.it>
In reply to#1464031
On Tue, Aug 16, 2016 at 08:45:02PM +0100, Ben Hutchings wrote:
> On Sun, 2016-08-14 at 09:36 +1000, Dave Chinner wrote:
> > On Sat, Aug 13, 2016 at 06:42:51PM +0100, Ben Hutchings wrote:
> > > 
> > > 3.16.37-rc1 review patch.  If anyone has any objections, please let me know.
> > > 
> > > ------------------
> > > 
> > > > > From: Dave Chinner <dchinner@redhat.com>
> > > 
> > > commit b1438f477934f5a4d5a44df26f3079a7575d5946 upstream.
> > > 
> > > When a failure due to an inode buffer occurs, the error handling
> > > fails to abort the inode writeback correctly. This can result in the
> > > inode being reclaimed whilst still in the AIL, leading to
> > > use-after-free situations as well as filesystems that cannot be
> > > unmounted as the inode log items left in the AIL never get removed.
> > > 
> > > Fix this by ensuring fatal errors from xfs_imap_to_bp() result in
> > > the inode flush being aborted correctly.
> > ....
> > > 
> > >  
> > > > >  	/*
> > > > > -	 * Get the buffer containing the on-disk inode.
> > > > > +	 * Get the buffer containing the on-disk inode. We are doing a try-lock
> > > > > +	 * operation here, so we may get  an EAGAIN error. In that case, we
> > > > > +	 * simply want to return with the inode still dirty.
> > > > > +	 *
> > > > > +	 * If we get any other error, we effectively have a corruption situation
> > > > > +	 * and we cannot flush the inode, so we treat it the same as failing
> > > > > +	 * xfs_iflush_int().
> > > > >  	 */
> > > > >  	error = xfs_imap_to_bp(mp, NULL, &ip->i_imap, &dip, &bp, XBF_TRYLOCK,
> > > > >  			       0);
> > > > > -	if (error || !bp) {
> > > > > +	if (error == -EAGAIN) {
> > 
> > Wrong. As was pointed out for other -stable trees after users
> > reported regressions, the error signs in XFS changed from positive
> > to negative in 3.17-rc1.
> 
> OK, so do I just need to delete the minus sign there?

Yes.

-Dave.
-- 
Dave Chinner
dchinner@redhat.com

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web