Looks good in limited testing. I set some extra debug code somewhere,
causing every failed mount in xfstests #078 to show up, so the
original test cases were double-checked, both on the main partition
(mid-upgrade) and on a backup boot partition:
Before Liu Patch v2:
#078, 32-bit Linux, larger partitions: PASS
#078, 32-bit Linux, smaller partitions: soft oops before test could fail
After Liu Patch v2:
#078, 32-bit Linux, larger partitions: PASS
#078, 32-bit Linux, smaller partitions: FAIL, no space left on device (CORRECT)
64-bit cases were not tested. Additionally, tests 001-005 were run
(for my sake), and test 112 was run (pass).
The main partition on this PC for / is XFS, and I still have a file
system, so that's a good sign. A gcc compile was left running because
I had to go to work, and I'll let you know if I don't have a file
system when I get back home.
Conclusion: Success on 32-bit, and failure is not seen for the near
future. Testing in the next 24 hours may change this conclusion.
Thanks!
Michael
On Mon, Mar 18, 2013 at 12:48 AM, Jeff Liu <jeff.liu@xxxxxxxxxx> wrote:
> Hello,
>
> Here is the v2 patch for fixing ASSERTION failed at xfs_vm_write_failed()
> according
> to Dave's comments, so I added Dave as SOB for credit.
>
> Hi Michael,
> Please kindly try at your at your convenience.
>
> Thanks,
> -Jeff
> This patch fix the block_offset evaluation to clear the lower 12 bits as:
> block_offset = pos >> PAGE_CACHE_SHIFT) << PAGE_CACHE_SHIFT
> Hence, the ASSERTION should be correct because the from offset in a page
> is evaluated to have the lower 12 bits only.
>
> Thanks Dave Chinner for pointing this out.
>
> Reported-by: Michael L. Semon <mlsemon35@xxxxxxxxx>
> Signed-off-by: Jie Liu <jeff.liu@xxxxxxxxxx>
> Signed-off-by: Dave Chinner <david@xxxxxxxxxxxxx>
> ---
> fs/xfs/xfs_aops.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
> index 5f707e5..a418e17 100644
> --- a/fs/xfs/xfs_aops.c
> +++ b/fs/xfs/xfs_aops.c
> @@ -1494,7 +1494,8 @@ xfs_vm_write_failed(
> loff_t pos,
> unsigned len)
> {
> - loff_t block_offset = pos & PAGE_MASK;
> + loff_t block_offset = (pos >> PAGE_CACHE_SHIFT) <<
> + PAGE_CACHE_SHIFT;
> loff_t block_start;
> loff_t block_end;
> loff_t from = pos & (PAGE_CACHE_SIZE - 1);
> --
> 1.7.9.5
|