public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: "Vairavanathan, Emalayan" <Emalayan.Vairavanathan@netapp.com>
Cc: "linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>
Subject: Re: [Question] Behaviour of directory listing in XFS with concurrent deletes
Date: Tue, 10 Apr 2018 19:20:01 +1000	[thread overview]
Message-ID: <20180410092001.GW23861@dastard> (raw)
In-Reply-To: <BLUPR0601MB0929F6CB22C71DE3E6E65F28F1BF0@BLUPR0601MB0929.namprd06.prod.outlook.com>

[ Please word wrap your emails at 72 columns! ]

On Tue, Apr 10, 2018 at 12:24:55AM +0000, Vairavanathan, Emalayan
wrote:
> Hi Dave,
> 
> Thank you for getting back to me. Please see my response inline.
> 
> >> What's does "false-negative" mean?  I don't know what your
> >> application is trying to do, so I don't know what your failure
> >> criteria is...
> 
> Assume the following :
> 
> 1) No failures (application crash OR disk / sector errors OR any
> form of disk or memory corruption)
> 2) xfs file-system is mounted with dirsync option.
> 3) A directory in XFS with 1.2 million files. fsync() was called
> on each file after creation.

Directory Size, dirsync, fsync, and failures are irrelevant to
readdir vs concurrent unlink behaviour.

> 4) An application with two threads (Thread-A and Thread-B) that
> uses this directory. Thread-A iterates through the directory and
> lists the names of all the files in the directory using readdir
> calls. The Thread-B  concurrently deletes some files from the
> directory.
> 5) Files can be only deleted from the directory. No new files will
> be created once the directory listing is started and we have a
> coordination layer to ensure this. 

> Given this context:
> - False-positive means a file that was deleted by Thread-B is seen
> by Thread-A. 
> - False-negative means a file that is already in the directory is
> not seen by Thread-A (due to concurrent deletes of some other
> files in the directory).
> 
> Does this make sense ?

Yes.

> I know that false-positives are possible in this context.

Right, POSIX explicitly states that behaviour of readdir() w.r.t.
files added/deleted after opendir()/rewinddir() is unspecified.

> Is it possible to see false negatives in this
> context? 

No.

-Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2018-04-10  9:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-05 23:53 [Question] Behaviour of directory listing in XFS with concurrent deletes Vairavanathan, Emalayan
2018-04-06  1:18 ` Dave Chinner
2018-04-10  0:24   ` Vairavanathan, Emalayan
2018-04-10  9:20     ` Dave Chinner [this message]
2018-04-10 20:10       ` Vairavanathan, Emalayan

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=20180410092001.GW23861@dastard \
    --to=david@fromorbit.com \
    --cc=Emalayan.Vairavanathan@netapp.com \
    --cc=linux-xfs@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