All of lore.kernel.org
 help / color / mirror / Atom feed
* read(2) hangs on the client side
@ 2005-05-08 11:33 Haakon Riiser
  2005-05-08 12:54 ` Trond Myklebust
  0 siblings, 1 reply; 14+ messages in thread
From: Haakon Riiser @ 2005-05-08 11:33 UTC (permalink / raw)
  To: nfs

I have noticed that there is a specific case that can lock up the
client while doing read(2), and it seems to be a race condition that
only occures in a very specific situation.  I will try to describe
this in as much detail as possible, since it is unlikely that you'll
be able to reproduce the bug for yourselves:

A big file (~ 250 MB) is shared on the NFS server.  The NFS server
also acts as a Samba server, so that Windows machines can use it.
One of the Windows machines is running the eMule P2P client,
and it makes some of the Samba-hosted files available on the
eMule network.

The hang has _only_ happened when I try to access a shared file
via NFS while it is _simultaneously_ being accessed (via Samba)
by the eMule machine.  To reproduce the hang from the NFS client's
side, I use this C program:

        #include <sys/types.h>
        #include <sys/stat.h>
        #include <fcntl.h>
        #include <unistd.h>

        int main(int argc, char *argv[])
        {
                for (;;) {
                        char buf[4096];
                        int fd = open(argv[1], O_RDONLY);
                        read(fd, buf, 4096);
                        close(fd);
                }
                return 0;
        }

It always hangs in the read() call, usually in the first iteration,
and after it does, _nothing_ can kill it, not even SIGKILL,
and until the next reboot, _any_ NFS operation -- even stat() --
on the accessed file will now hang.

I have no idea how Samba + eMule's access patterns look like,
but I know with 100 % certainty that it is the cause.  If I move
the file in question out of eMule's shared directory, I can never
hang the NFS client no matter how long I run the above program.
If I move it back in, it hangs almost instantly. :-(

Note that only the Linux NFS client machine is seemingly affected by
this -- both the NFS/Samba server and the eMule-running Samba client
are doing just fine while the hang happens on the Linux client.

Some system info:

NFS client:
  Slackware 10.1
  Linux 2.6.11
  nfs-utils 1.0.7
  glibc 2.3.4
  util-linux 2.12p

NFS server:
  Fedora Core 3 (fully updated)
  Linux 2.6.11-1.14_FC3
  nfs-utils-1.0.6-52
  glibc-2.3.5-0.fc3.1
  Samba 3.0.15pre2-1
  util-linux-2.12a-24.2

Any help in further analysis would be greatly appreciated!

-- 
 Haakon


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

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

end of thread, other threads:[~2005-05-15  7:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-08 11:33 read(2) hangs on the client side Haakon Riiser
2005-05-08 12:54 ` Trond Myklebust
2005-05-08 13:21   ` Haakon Riiser
2005-05-08 13:59     ` Trond Myklebust
2005-05-08 14:37       ` Haakon Riiser
2005-05-09 10:38         ` Trond Myklebust
2005-05-09 14:13           ` Haakon Riiser
2005-05-11 14:23             ` Trond Myklebust
2005-05-14 22:39               ` Haakon Riiser
2005-05-14 23:38                 ` Trond Myklebust
2005-05-15  6:21                   ` Haakon Riiser
2005-05-15  6:39                     ` Trond Myklebust
2005-05-15  6:54                       ` Haakon Riiser
2005-05-15  7:00                         ` Trond Myklebust

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.