All of lore.kernel.org
 help / color / mirror / Atom feed
* git "make test" fails in t9200-git-cvsexportcommit.sh
@ 2017-03-14 15:07 Chuck Lever
  2017-03-14 22:25 ` Benjamin Coddington
  0 siblings, 1 reply; 4+ messages in thread
From: Chuck Lever @ 2017-03-14 15:07 UTC (permalink / raw)
  To: Benjamin Coddington; +Cc: Linux NFS Mailing List

Hi Ben!

After addressing some IB stack issues that arose in v4.11-rc1,
I was finally able to run my standard suite of NFS tests with
v4.11-rc2. I found that part of the git regression suite fails
with this kernel.

Initially I start simply with NFSv3 and a tmpfs export. To
prepare for the test, my script does something like this:

$ cd /mnt/server
$ tar zxf ~/Downloads/git-2.3.7.tgz
$ cd git
$ make clean
$ make
$ cd t

Then, by hand:

    [cel@manet t]$ ./t9200-git-cvsexportcommit.sh
    ok 1 - New file
    ok 2 - Remove two files, add two and update two
    ok 3 - Fail to change binary more than one generation old
    ok 4 - Remove only binary files
    ok 5 - Remove only a text file
    ok 6 - New file with spaces in file name
    ok 7 - Update file with spaces in file name
    ok 8 - File with non-ascii file name
    ok 9 - Mismatching patch should fail
    ok 10 - Retain execute bit
    ok 11 - -w option should work with relative GIT_DIR
    ok 12 - check files before directories
    not ok 13 - re-commit a removed filename which remains in CVS attic
    #
    #
    #       (cd "$CVSWORK" &&
    #        echo >attic_gremlin &&
    #        cvs -Q add attic_gremlin &&
    #        cvs -Q ci -m "added attic_gremlin" &&
    #        rm attic_gremlin &&
    #        cvs -Q rm attic_gremlin &&
    #        cvs -Q ci -m "removed attic_gremlin") &&
    #
    #       echo > attic_gremlin &&
    #       git add attic_gremlin &&
    #       git commit -m "Added attic_gremlin" &&
    #           git cvsexportcommit -w "$CVSWORK" -c HEAD &&
    #       (cd "$CVSWORK"; cvs -Q update -d) &&
    #       test -f "$CVSWORK/attic_gremlin"
    #
    not ok 14 - commit a file with leading spaces in the name
    #
    #
    #           echo space > " space" &&
    #           git add " space" &&
    #           git commit -m "Add a file with a leading space" &&
    #           id=3D$(git rev-parse HEAD) &&
    #           git cvsexportcommit -w "$CVSWORK" -c $id &&
    #           check_entries "$CVSWORK" " =
space/1.1/|DS/1.1/|attic_gremlin/1.3/|release-notes/1.2/" &&
    #           test_cmp "$CVSWORK/ space" " space"
    #
    #
    ok 15 - use the same checkout for Git and CVS
    # failed 2 among 15 test(s)
    1..15
    [cel@manet t]$

A wire capture shows that some GETATTR operations receive
an NFS3ERR_STALE response from the server. I looked at one
of these, and it's against a renamed file "index.lock".

So I reverted:

commit 920b4530fb80430ff30ef83efe21ba1fa5623731
Author:     Benjamin Coddington <bcodding@redhat.com>
Date: Wed Feb 1 00:00:07 2017 -0500

NFS: nfs_rename() handle -ERESTARTSYS dentry left behind

And t9200 now passes:

    [cel@manet t]$ ./t9200-git-cvsexportcommit.sh=20
    ok 1 - New file
    ok 2 - Remove two files, add two and update two
    ok 3 - Fail to change binary more than one generation old
    ok 4 - Remove only binary files
    ok 5 - Remove only a text file
    ok 6 - New file with spaces in file name
    ok 7 - Update file with spaces in file name
    ok 8 - File with non-ascii file name
    ok 9 - Mismatching patch should fail
    ok 10 - Retain execute bit
    ok 11 - -w option should work with relative GIT_DIR
    ok 12 - check files before directories
    ok 13 - re-commit a removed filename which remains in CVS attic
    ok 14 - commit a file with leading spaces in the name
    ok 15 - use the same checkout for Git and CVS
    # passed all 15 test(s)
    1..15
    [cel@manet t]$

Wire capture shows no NFS3ERR_STALE results on the wire
during the successful test run.


--
Chuck Lever

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git "make test" fails in t9200-git-cvsexportcommit.sh
  2017-03-14 15:07 git "make test" fails in t9200-git-cvsexportcommit.sh Chuck Lever
@ 2017-03-14 22:25 ` Benjamin Coddington
  2017-03-15 14:00   ` Benjamin Coddington
  0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Coddington @ 2017-03-14 22:25 UTC (permalink / raw)
  To: Chuck Lever; +Cc: Linux NFS Mailing List

Hi Chuck,

On 14 Mar 2017, at 11:07, Chuck Lever wrote:

> Hi Ben!
>
> After addressing some IB stack issues that arose in v4.11-rc1,
> I was finally able to run my standard suite of NFS tests with
> v4.11-rc2. I found that part of the git regression suite fails
> with this kernel.
> ...
> A wire capture shows that some GETATTR operations receive
> an NFS3ERR_STALE response from the server. I looked at one
> of these, and it's against a renamed file "index.lock".
>
> So I reverted:
>
> commit 920b4530fb80430ff30ef83efe21ba1fa5623731
> Author:     Benjamin Coddington <bcodding@redhat.com>
> Date: Wed Feb 1 00:00:07 2017 -0500
>
> NFS: nfs_rename() handle -ERESTARTSYS dentry left behind
>
> And t9200 now passes:

Yep, something seems to be wrong with calling
nfs_mark_for_revalidate(old_inode) in rpc_call_done instead of after
rpc_release.  Thanks for catching this.  I'm out of time today, and will
look at this in the morning.

Ben

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git "make test" fails in t9200-git-cvsexportcommit.sh
  2017-03-14 22:25 ` Benjamin Coddington
@ 2017-03-15 14:00   ` Benjamin Coddington
  2017-03-15 18:30     ` Chuck Lever
  0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Coddington @ 2017-03-15 14:00 UTC (permalink / raw)
  To: Chuck Lever; +Cc: Linux NFS Mailing List

On 14 Mar 2017, at 18:25, Benjamin Coddington wrote:

> Hi Chuck,
>
> On 14 Mar 2017, at 11:07, Chuck Lever wrote:
>
>> Hi Ben!
>>
>> After addressing some IB stack issues that arose in v4.11-rc1,
>> I was finally able to run my standard suite of NFS tests with
>> v4.11-rc2. I found that part of the git regression suite fails
>> with this kernel.
>> ...
>> A wire capture shows that some GETATTR operations receive
>> an NFS3ERR_STALE response from the server. I looked at one
>> of these, and it's against a renamed file "index.lock".
>>
>> So I reverted:
>>
>> commit 920b4530fb80430ff30ef83efe21ba1fa5623731
>> Author:     Benjamin Coddington <bcodding@redhat.com>
>> Date: Wed Feb 1 00:00:07 2017 -0500
>>
>> NFS: nfs_rename() handle -ERESTARTSYS dentry left behind
>>
>> And t9200 now passes:
>
> Yep, something seems to be wrong with calling
> nfs_mark_for_revalidate(old_inode) in rpc_call_done instead of after
> rpc_release.  Thanks for catching this.  I'm out of time today, and 
> will
> look at this in the morning.

I found the test was doing something like:

  rename("/mnt/localhost/attic_gremlin,", 
"/mnt/localhost/attic_gremlin,v") = 0
  open("attic_gremlin", O_RDONLY) = 7
  open("attic_gremlin,v", O_RDONLY) = 8

So, I think the problem is that patch moved the d_move() before
d_rehash(new_inode).. so it's actually rehasing the old dentry's name.  
I'm testing
the following fix:

 From 425f85c59142fe0821d30b11ba0df7704ebf6de6 Mon Sep 17 00:00:00 2001
Message-Id: 
<425f85c59142fe0821d30b11ba0df7704ebf6de6.1489586013.git.bcodding@redhat.com>
 From: Benjamin Coddington <bcodding@redhat.com>
Date: Wed, 15 Mar 2017 08:06:38 -0400
Subject: [PATCH] NFS: Fix old dentry rehash after move

Now that nfs_rename()'s d_move has moved within the RPC task's 
rpc_call_done
callback, rehashing new_dentry will actually rehash the old dentry's 
name
in nfs_rename().  d_move() is going to rehash the new dentry for us 
anyway,
so doing it again here is unnecessary.

Reported-by: Chuck Lever <chuck.lever@oracle.com>
Fixes: 920b4530fb80 ("NFS: nfs_rename() handle -ERESTARTSYS dentry left 
behind")
---
  fs/nfs/dir.c | 9 ++-------
  1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index fb499a3f21b5..f92ba8d6c556 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -2055,7 +2055,7 @@ int nfs_rename(struct inode *old_dir, struct 
dentry *old_dentry,
  {
     struct inode *old_inode = d_inode(old_dentry);
     struct inode *new_inode = d_inode(new_dentry);
-   struct dentry *dentry = NULL, *rehash = NULL;
+   struct dentry *dentry = NULL;
     struct rpc_task *task;
     int error = -EBUSY;

@@ -2078,10 +2078,8 @@ int nfs_rename(struct inode *old_dir, struct 
dentry *old_dentry,
          * To prevent any new references to the target during the
          * rename, we unhash the dentry in advance.
          */
-       if (!d_unhashed(new_dentry)) {
+       if (!d_unhashed(new_dentry))
             d_drop(new_dentry);
-           rehash = new_dentry;
-       }

         if (d_count(new_dentry) > 2) {
             int err;
@@ -2098,7 +2096,6 @@ int nfs_rename(struct inode *old_dir, struct 
dentry *old_dentry,
                 goto out;

             new_dentry = dentry;
-           rehash = NULL;
             new_inode = NULL;
         }
     }
@@ -2119,8 +2116,6 @@ int nfs_rename(struct inode *old_dir, struct 
dentry *old_dentry,
         error = task->tk_status;
     rpc_put_task(task);
  out:
-   if (rehash)
-       d_rehash(rehash);
     trace_nfs_rename_exit(old_dir, old_dentry,
             new_dir, new_dentry, error);
     /* new dentry created? */
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: git "make test" fails in t9200-git-cvsexportcommit.sh
  2017-03-15 14:00   ` Benjamin Coddington
@ 2017-03-15 18:30     ` Chuck Lever
  0 siblings, 0 replies; 4+ messages in thread
From: Chuck Lever @ 2017-03-15 18:30 UTC (permalink / raw)
  To: Benjamin Coddington; +Cc: Linux NFS Mailing List


> On Mar 15, 2017, at 10:00 AM, Benjamin Coddington =
<bcodding@redhat.com> wrote:
>=20
> On 14 Mar 2017, at 18:25, Benjamin Coddington wrote:
>=20
>> Hi Chuck,
>>=20
>> On 14 Mar 2017, at 11:07, Chuck Lever wrote:
>>=20
>>> Hi Ben!
>>>=20
>>> After addressing some IB stack issues that arose in v4.11-rc1,
>>> I was finally able to run my standard suite of NFS tests with
>>> v4.11-rc2. I found that part of the git regression suite fails
>>> with this kernel.
>>> ...
>>> A wire capture shows that some GETATTR operations receive
>>> an NFS3ERR_STALE response from the server. I looked at one
>>> of these, and it's against a renamed file "index.lock".
>>>=20
>>> So I reverted:
>>>=20
>>> commit 920b4530fb80430ff30ef83efe21ba1fa5623731
>>> Author:     Benjamin Coddington <bcodding@redhat.com>
>>> Date: Wed Feb 1 00:00:07 2017 -0500
>>>=20
>>> NFS: nfs_rename() handle -ERESTARTSYS dentry left behind
>>>=20
>>> And t9200 now passes:
>>=20
>> Yep, something seems to be wrong with calling
>> nfs_mark_for_revalidate(old_inode) in rpc_call_done instead of after
>> rpc_release.  Thanks for catching this.  I'm out of time today, and =
will
>> look at this in the morning.
>=20
> I found the test was doing something like:
>=20
> rename("/mnt/localhost/attic_gremlin,", =
"/mnt/localhost/attic_gremlin,v") =3D 0
> open("attic_gremlin", O_RDONLY) =3D 7
> open("attic_gremlin,v", O_RDONLY) =3D 8
>=20
> So, I think the problem is that patch moved the d_move() before
> d_rehash(new_inode).. so it's actually rehasing the old dentry's name. =
 I'm testing
> the following fix:

I applied this to my client, and was not able to reproduce the problem.

Tested-by: Chuck Lever <chuck.lever@oracle.com>


> =46rom 425f85c59142fe0821d30b11ba0df7704ebf6de6 Mon Sep 17 00:00:00 =
2001
> Message-Id: =
<425f85c59142fe0821d30b11ba0df7704ebf6de6.1489586013.git.bcodding@redhat.c=
om>
> From: Benjamin Coddington <bcodding@redhat.com>
> Date: Wed, 15 Mar 2017 08:06:38 -0400
> Subject: [PATCH] NFS: Fix old dentry rehash after move
>=20
> Now that nfs_rename()'s d_move has moved within the RPC task's =
rpc_call_done
> callback, rehashing new_dentry will actually rehash the old dentry's =
name
> in nfs_rename().  d_move() is going to rehash the new dentry for us =
anyway,
> so doing it again here is unnecessary.
>=20
> Reported-by: Chuck Lever <chuck.lever@oracle.com>
> Fixes: 920b4530fb80 ("NFS: nfs_rename() handle -ERESTARTSYS dentry =
left behind")
> ---
> fs/nfs/dir.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>=20
> diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
> index fb499a3f21b5..f92ba8d6c556 100644
> --- a/fs/nfs/dir.c
> +++ b/fs/nfs/dir.c
> @@ -2055,7 +2055,7 @@ int nfs_rename(struct inode *old_dir, struct =
dentry *old_dentry,
> {
>    struct inode *old_inode =3D d_inode(old_dentry);
>    struct inode *new_inode =3D d_inode(new_dentry);
> -   struct dentry *dentry =3D NULL, *rehash =3D NULL;
> +   struct dentry *dentry =3D NULL;
>    struct rpc_task *task;
>    int error =3D -EBUSY;
>=20
> @@ -2078,10 +2078,8 @@ int nfs_rename(struct inode *old_dir, struct =
dentry *old_dentry,
>         * To prevent any new references to the target during the
>         * rename, we unhash the dentry in advance.
>         */
> -       if (!d_unhashed(new_dentry)) {
> +       if (!d_unhashed(new_dentry))
>            d_drop(new_dentry);
> -           rehash =3D new_dentry;
> -       }
>=20
>        if (d_count(new_dentry) > 2) {
>            int err;
> @@ -2098,7 +2096,6 @@ int nfs_rename(struct inode *old_dir, struct =
dentry *old_dentry,
>                goto out;
>=20
>            new_dentry =3D dentry;
> -           rehash =3D NULL;
>            new_inode =3D NULL;
>        }
>    }
> @@ -2119,8 +2116,6 @@ int nfs_rename(struct inode *old_dir, struct =
dentry *old_dentry,
>        error =3D task->tk_status;
>    rpc_put_task(task);
> out:
> -   if (rehash)
> -       d_rehash(rehash);
>    trace_nfs_rename_exit(old_dir, old_dentry,
>            new_dir, new_dentry, error);
>    /* new dentry created? */
> --=20
> 2.9.3

--
Chuck Lever

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-15 18:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-14 15:07 git "make test" fails in t9200-git-cvsexportcommit.sh Chuck Lever
2017-03-14 22:25 ` Benjamin Coddington
2017-03-15 14:00   ` Benjamin Coddington
2017-03-15 18:30     ` Chuck Lever

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.