]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
client: return errors to the user if fsync fails
authorGreg Farnum <greg@inktank.com>
Wed, 30 Jan 2013 01:05:56 +0000 (17:05 -0800)
committerGreg Farnum <greg@inktank.com>
Wed, 30 Jan 2013 01:05:56 +0000 (17:05 -0800)
commite9a6694d0151b79c3a3b44cee5df8e3d4dcbfc2c
tree6c1abbcad0479c05be2c59e9bab74c7ec92ac713
parent7cd4e50ddf103d93308715218ec2735d93d493ac
client: return errors to the user if fsync fails

To do so, we allow callers of _flush(Inode) to pass in a Context
as well. This Context is then given to the ObjectCacher as
the completion callback instead of the C_Client_PutInode that
it uses by default. _fsync() passes in a SafeCond which is
pointing to its return code, and presto! The return code gets
a failure if the Objecter returns any.
To preserve existing semantics, _fsync() (and any similar
caller) is now required to take a reference to the inode.

However, this is a behavioral change: previously, a call to fsync
in the userspace code would simply spin as it waited for all the
data to flush out. That obviously wasn't desirable, but now a user
can call fsync, ignore the return value, and think that everything is
hunky-dory when in fact the client is repeatedly trying to flush out
the dirty data. Hrm...

This fixes the fsync case of #2753 for ceph-fuse.

Signed-off-by: Greg Farnum <greg@inktank.com>
src/client/Client.cc
src/client/Client.h