On 02/27/2015 01:56 PM, Alexandre DERUMIER wrote:
> Hi,
> 
> from qemu rbd.c
> 
>     if (flags & BDRV_O_NOCACHE) {
>         rados_conf_set(s->cluster, "rbd_cache", "false");
>     } else {
>         rados_conf_set(s->cluster, "rbd_cache", "true");
>     }
> 
> and
> block.c
> 
> int bdrv_parse_cache_flags(const char *mode, int *flags)
> {
>     *flags &= ~BDRV_O_CACHE_MASK;
> 
>     if (!strcmp(mode, "off") || !strcmp(mode, "none")) {
>         *flags |= BDRV_O_NOCACHE | BDRV_O_CACHE_WB;
>     } else if (!strcmp(mode, "directsync")) {
>         *flags |= BDRV_O_NOCACHE;
>     } else if (!strcmp(mode, "writeback")) {
>         *flags |= BDRV_O_CACHE_WB;
>     } else if (!strcmp(mode, "unsafe")) {
>         *flags |= BDRV_O_CACHE_WB;
>         *flags |= BDRV_O_NO_FLUSH;
>     } else if (!strcmp(mode, "writethrough")) {
>         /* this is the default */
>     } else {
>         return -1;
>     }
> 
>     return 0;
> }
> 
> 
> So rbd_cache is 
> 
> disabled for cache=directsync|none
> 
> and enabled for writethrough|writeback|unsafe
> 
> 
> so directsync or none should be safe if guest does not send flush.

That's what I figured too, but then where does the "important" warning
in the documentation come from that implores people to always set
"writeback"? As per git blame it came directly from Josh. If anyone's an
authority on RBD, it would be him. :)

Cheers,
Florian

_______________________________________________
ceph-users mailing list
ceph-users@lists.ceph.com
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com

Reply via email to