linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: larith <larith@go2.pl>
Cc: linux-nfs@vger.kernel.org
Subject: Re: stat family function problem (php file_exists)
Date: Thu, 24 Feb 2011 16:37:34 -0800	[thread overview]
Message-ID: <1298594254.4606.6.camel@heimdal.trondhjem.org> (raw)
In-Reply-To: <3c95bae3.61f80ace.4d666374.d4ebc@go2.pl>

On Thu, 2011-02-24 at 14:56 +0100, larith wrote: 
> Hi
> 
> I have one nfs server mounted on 2 clients. If I check on client2 if a file exists, then after creating this file on client2 is is not immediately visible to file_exist() function on client2. it was only after some time. how to fix this ?

1) Use open() instead of stat()

or

2) Use the -olookupcache=  mount option (see 'man 5 nfs').

Trond

> client1:/mnt/storage0/test# cat a.php
> <?php
> 
> if (file_exists ($argv[1])) {
>     echo "1\n";
> } else {
>     echo "0\n";
> }

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com


      reply	other threads:[~2011-02-25  0:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-24 13:56 stat family function problem (php file_exists) larith
2011-02-25  0:37 ` Trond Myklebust [this message]

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=1298594254.4606.6.camel@heimdal.trondhjem.org \
    --to=trond.myklebust@netapp.com \
    --cc=larith@go2.pl \
    --cc=linux-nfs@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).