public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joel Becker <Joel.Becker@oracle.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Roland Dreier <rdreier@cisco.com>, Mark Fasheh <mfasheh@suse.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	ocfs2-devel@oss.oracle.com
Subject: Re: [GIT PULL] ocfs2 changes for 2.6.32
Date: Thu, 17 Sep 2009 13:34:54 -0700	[thread overview]
Message-ID: <20090917203453.GA15620@mail.oracle.com> (raw)
In-Reply-To: <alpine.LFD.2.01.0909171316230.4950@localhost.localdomain>

On Thu, Sep 17, 2009 at 01:17:55PM -0700, Linus Torvalds wrote:
> On Thu, 17 Sep 2009, Roland Dreier wrote:
> > 
> > I guess one bit of semantics to figure out is what happens if copyfile()
> > does the async case but then copyfile_ctrl() returns an error halfway
> > through... is the state of the dest file just undefined?
> 
> I think that's the one that most filesystems would prefer. Maybe the file 
> is there, it's just that it's only half copied because the filesystem 
> filled up. 

	I have to say, adding 'undefined behavior' things isn't fun in a
call that is already potentially confusing.  We have a bunch of flags
and behaviors we're covering.

> Making filesystems give atomicity guarantees would be hard for the async 
> case. 

	Note that "cleaning up after an error" and "atomic" are not the
same.  Atomicity implies that not only do you see all or none, but that
the contents are a point-in-time of the source file.  A non-atomic
implementation may be affected by writes that happen during the copy
(like any read-write-loop copy would be).
	As an example, ocfs2_reflink() builds the target inode in the
orphan directory.  If the operation fails at any point, it's removed.
If we crash, orphan cleanup happens.  Only if it succeeds do we move it
to the target directory.  ocfs2_reflink() is an atomic snapshot, of
course, but recoverability is certainly possible for a non-atomic
copyfile() on filesystems with similar orphan schemes (ext3 is the
obvious example).
	Of course, how the network filesystems might see it, I don't
know.  NFS/CIFS folks, please speak up.

> Of course, if the filesystem can do the copy entirely atomically (ie by 
> just incrementing a refcount), then it can give atomicity guarantees, but 
> then you'd never see the async case either.

	Even the atomic copy might take a little time (say, to bump up
and write out the metadata structures).  Do you want to define that as
not being async?  I was figuring COPYFILE_ATOMIC and COPYFILE_WAIT to be
separate flags.

Joel

-- 

"Behind every successful man there's a lot of unsuccessful years."
        - Bob Brown

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127

  reply	other threads:[~2009-09-17 20:36 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11 20:04 [GIT PULL] ocfs2 changes for 2.6.32 Joel Becker
2009-09-14 21:32 ` Linus Torvalds
2009-09-14 22:14   ` Joel Becker
2009-09-14 23:27     ` Linus Torvalds
2009-09-15  0:04       ` Joel Becker
2009-09-15  0:31         ` Linus Torvalds
2009-09-15  0:54           ` Joel Becker
2009-09-15  2:01             ` Linus Torvalds
2009-09-15  4:05               ` Arjan van de Ven
2009-09-15  4:35                 ` Joel Becker
2009-09-15  4:06               ` Joel Becker
2009-09-15 16:30                 ` Linus Torvalds
2009-09-15 21:45                   ` Joel Becker
2009-09-16  4:20                     ` Linus Torvalds
2009-09-16  4:40                       ` Joel Becker
2009-09-17 16:29                         ` Linus Torvalds
2009-09-17 16:38                           ` Arjan van de Ven
2009-09-17 20:16                             ` Linus Torvalds
2009-09-17 18:40                           ` Roland Dreier
2009-09-17 20:17                             ` Linus Torvalds
2009-09-17 20:34                               ` Joel Becker [this message]
2009-09-18  0:29                                 ` Linus Torvalds
2009-09-17 20:42                               ` Roland Dreier
2009-09-17 20:55                                 ` Linus Torvalds
2009-09-18  1:43                           ` [Ocfs2-devel] " Joel Becker
2009-09-18 13:34                             ` Pádraig Brady
2009-09-18 18:37                               ` Joel Becker
2009-09-18 17:23                             ` Peter W. Morreale
2009-09-18 18:39                               ` Joel Becker
2009-09-15  6:44   ` Miklos Szeredi
2009-09-23 11:02   ` [GIT PULL] ocfs2 changes for 2.6.32 (take 2, no syscall) Joel Becker
  -- strict thread matches above, loose matches on Subject: below --
2009-09-22  0:51 [GIT PULL] ocfs2 changes for 2.6.32 George Spelvin
2009-09-22  3:28 George Spelvin

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=20090917203453.GA15620@mail.oracle.com \
    --to=joel.becker@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mfasheh@suse.com \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=rdreier@cisco.com \
    --cc=torvalds@linux-foundation.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