xfs
[Top] [All Lists]

Re: [PATCH 4/6] libxfs: reused invalidated buffers leak state and data

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 4/6] libxfs: reused invalidated buffers leak state and data
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Fri, 4 Jul 2014 07:15:09 -0700
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1404453435-1915-5-git-send-email-david@xxxxxxxxxxxxx>
References: <1404453435-1915-1-git-send-email-david@xxxxxxxxxxxxx> <1404453435-1915-5-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.23 (2014-03-12)
On Fri, Jul 04, 2014 at 03:57:13PM +1000, Dave Chinner wrote:
> @@ -632,6 +632,12 @@ libxfs_putbuf(xfs_buf_t *bp)
>                       pthread_mutex_unlock(&bp->b_lock);
>               }
>       }
> +     /*
> +      * ensure that any errors on this use of the buffer don't carry
> +      * over to the next user.
> +      */
> +     bp->b_error = 0;
> +
>       cache_node_put(libxfs_bcache, (struct cache_node *)bp);

This seems a bit fishy to me.  For one I'm pretty sure it needs to be
done before unlocking b_lock, second it's different behavior from the
kernel where we explicitly clear it in the caller for the rare case
we want to reuse a buffer that had an error (xfs_buf_iodone_callbacks
seems to be the only one).  Any reason to do this differently in
userspace?

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