public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Janne Karhunen <Janne.Karhunen@gmail.com>
To: Peter Staubach <staubach@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: NFSv3 client reordering RENAMEs
Date: Fri, 16 Jun 2006 09:25:50 +0300	[thread overview]
Message-ID: <200606160925.51332.Janne.Karhunen@gmail.com> (raw)
In-Reply-To: <44918545.2090002@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 482 bytes --]

On Thursday 15 June 2006 19:05, Peter Staubach wrote:

> >Possibly .. if someone first acks that this indeed would be
> >considered as bug and not as a feature :/
>
> Yes, I believe that this would be considered to be a bug...

Looks that this is a vendor kernel issue, couldn't get it to
barf on mainline. Without any more knowledge of the extent 
of the problem testcase attached. Given that you suffer from
the problem you should occasionally see files vanishing.


-- 
// Janne

[-- Attachment #2: test.c --]
[-- Type: text/x-csrc, Size: 1652 bytes --]

#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <pthread.h>
#include <stdlib.h>

#ifndef ROTATION_CYCLE
#define ROTATION_CYCLE 60
#endif

char*     str = "Quick brown fox jumped over lazy dog %d\n";
char      buf[50] = { 0 };
int       rl=1;
int       rr=1;
pthread_t thr[2];

void* logger_thread ( void* ptr ) {
  int i=0, r, fd;

  fd = open ( "/mnt/nfs/file", O_RDWR|O_CREAT, 00600 );
  printf ( "logger starting, fd %d\n", fd );

  if ( fd <= 0 ) {
    printf ("%s\n", strerror(errno));
    return NULL;
  }
  while ( rl ) {
    r = sprintf ( &buf[0], str, i );
    r = write ( fd, &buf[0], strlen(&buf[0]) );
    if ( r <= 0 ) {
      printf ("\n\n%s\n", strerror(errno));
      goto exit;
    }
    i++;
    usleep ( 10000 );
  }
exit:
  printf ("logger exiting\n");
  close (fd);
  return NULL;
}

void* logrotate_thread ( void* ptr ) {
  int r;

  printf ( "rotater starting\n" );
  while ( rr ) {
    sleep(ROTATION_CYCLE);

    r = system ( "mv /mnt/nfs/file.4 /mnt/nfs/file.5" );
    r = system ( "mv /mnt/nfs/file.3 /mnt/nfs/file.4" );
    r = system ( "mv /mnt/nfs/file.2 /mnt/nfs/file.3" );
    r = system ( "mv /mnt/nfs/file.1 /mnt/nfs/file.2" );
    r = system ( "mv /mnt/nfs/file /mnt/nfs/file.1" );
    rl=0;
    sleep(2);
    rl=1;
    pthread_create ( &thr[1], 0, logger_thread, 0 );
  }
  printf ( "rotater exiting\n" );
  return NULL;
}

int main ( int a, char** b ) {
  pthread_create ( &thr[0], 0, logrotate_thread, 0 );
  pthread_create ( &thr[0], 0, logger_thread, 0 );

  while ( 1 )
    usleep ( 100000 );
  return 0;
}


  reply	other threads:[~2006-06-16  6:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-15 13:38 NFSv3 client reordering RENAMEs Janne Karhunen
2006-06-15 13:44 ` Peter Staubach
2006-06-15 14:54   ` Janne Karhunen
2006-06-15 16:05     ` Peter Staubach
2006-06-16  6:25       ` Janne Karhunen [this message]
2006-06-16 13:45         ` Peter Staubach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200606160925.51332.Janne.Karhunen@gmail.com \
    --to=janne.karhunen@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=staubach@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox