xfs
[Top] [All Lists]

Re: xfs_fsr / xfs_swap_extents() broken in 3.8-rc4?

To: Torsten Kaiser <just.for.lkml@xxxxxxxxxxxxxx>
Subject: Re: xfs_fsr / xfs_swap_extents() broken in 3.8-rc4?
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Sun, 20 Jan 2013 10:17:47 +1100
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <CAPVoSvQAfX3tOPKzaMKp6oePc-FosRBKbVen2n-L4j3oHEGHag@xxxxxxxxxxxxxx>
References: <CAPVoSvQAfX3tOPKzaMKp6oePc-FosRBKbVen2n-L4j3oHEGHag@xxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Sat, Jan 19, 2013 at 06:15:40PM +0100, Torsten Kaiser wrote:
> Hi,
> 
> I just used xfs_fsr the first time under a 3.8-rc kernel and was
> spammed with an enormous amount of "XFS_IOC_SWAPEXT failed: ino=56118:
> Invalid argument" messages.
> 
> I found the thread http://marc.info/?t=135727980600001&r=1&w=2 and
> went to check the kernel sources for these additional checks, because
> I wanted to know what was allowed earlier and is now failing.
> 
> I found commit fb59581404ab7ec5075299065c22cb211a9262a9:
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=fb59581404ab7ec5075299065c22cb211a9262a9#patch2
> 
> --- a/fs/xfs/xfs_dfrag.c
> +++ b/fs/xfs/xfs_dfrag.c
> @@ -246,12 +246,10 @@ xfs_swap_extents(
>                 goto out_unlock;
>         }
> 
> -       if (VN_CACHED(VFS_I(tip)) != 0) {
> -               error = xfs_flushinval_pages(tip, 0, -1,
> -                               FI_REMAPF_LOCKED);
> -               if (error)
> -                       goto out_unlock;
> -       }
> +       error = -filemap_write_and_wait(VFS_I(ip)->i_mapping);
> +       if (error)
> +               goto out_unlock;
> +       truncate_pagecache_range(VFS_I(ip), 0, -1);
> 
> That looks really wrong to me. The old code was calling
> xfs_flushinval_pages() for *tip*, but the new code is working on *ip*.
> Was that change really intended? Is looks unintentional and is not
> mentioned in the commit comment...
> 
> Thanks for looking / correcting me if I'm missing something obvious,
> but I can't find a reason for this change...

I think you're right - good catch. Can you send the patch with a
proper subject, commit message and sign-ofif?

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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