xfs
[Top] [All Lists]

Re: [PATCH] xfs: fix broken error handling in xfs_vm_writepage

To: xfs@xxxxxxxxxxx
Subject: Re: [PATCH] xfs: fix broken error handling in xfs_vm_writepage
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Mon, 12 Nov 2012 11:58:35 +1100
In-reply-to: <1352681350-28541-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1352681350-28541-1-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Nov 12, 2012 at 11:49:10AM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> When we shut down the filesystem, it might first be detected in
> writeback when we are allocating a inode size transaction. This
> happens after we have moved all the pages into the writeback state
> and unlocked them. Unfortunately, if we fail to set up the
> transaction we then abort writeback and try to invalidate the
> current page. This then triggers are BUG() in block_invalidatepage()
> because we are trying to invalidate an unlocked page.

FWIW, I found this problem when testing recovery of wrapped log
buffers. The test:

$ cat t.sh
#!/bin/bash

while [ 1 ]; do
        mkfs.xfs -f /dev/vdb > /dev/null 2>&1
        mount /dev/vdb /mnt/scratch
        ./compilebench -D /mnt/scratch > /dev/null 2>&1 &
        sleep 36
        /home/dave/src/xfstests-dev/src/godown /mnt/scratch
        sleep 5
        umount /mnt/scratch
        xfs_logprint -d /dev/vdb |grep -B 1 "^\["
        mount /dev/vdb /mnt/scratch
        umount /mnt/scratch
done

would fail after 3-4 iterations due to the BUG() in
block_invalidatepage().  This fix has been running that loop for 2
hours now, so it's gone through over a hundred iterations without
failing now - it takes about 45s an iteration to run. Note that this
is also exercising the wrapped log buffer recovery fix on every
iteration, too.... :)

And FWIW, this probably should have a cc: <stable@xxxxxxxxxxxxxxx>
on it as well, as it is a recent regression that turns a shutdown
into hard failure....

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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