* Re: [RESEND PATCH 1/2] nvdimm: warn if the backend is not a DAX device
[not found] ` <14af6adf-9076-1368-75bb-8001ed667150@gmail.com>
@ 2017-06-01 13:53 ` Dan Williams
0 siblings, 0 replies; only message in thread
From: Dan Williams @ 2017-06-01 13:53 UTC (permalink / raw)
To: Xiao Guangrong
Cc: Haozhong Zhang, qemu-devel, Michael S. Tsirkin, Igor Mammedov,
Stefan Hajnoczi, linux-fsdevel
[ adding linux-fsdevel ]
On Thu, Jun 1, 2017 at 5:00 AM, Xiao Guangrong <guangrong.xiao@gmail.com> wrote:
>
>
> On 05/26/2017 10:32 AM, Haozhong Zhang wrote:
>
>> +static void nvdimm_check_dax(HostMemoryBackend *hostmem)
>> +{
>> + char *mem_path =
>> + object_property_get_str(OBJECT(hostmem), "mem-path", NULL);
>> + char *dev_name = NULL, *sysfs_path = NULL;
>> + bool is_dax = false;
>> +
>> + if (!mem_path) {
>> + goto out;
>> + }
>> +
>> + if (!g_str_has_prefix(mem_path, "/dev/dax")) {
>> + goto out;
>> + }
>> +
>> + dev_name = mem_path + strlen("/dev/");
>> + sysfs_path = g_strdup_printf("/sys/class/dax/%s", dev_name);
>> + if (access(sysfs_path, F_OK)) {
>> + goto out;
>> + }
>> +
>> + is_dax = true;
>> +
>
>
> So only dax raw disk has write-persistence guaranty, a pre-allocated
> file which locates on a DAX-enabled filesystem can not?
Correct, it is not guaranteed by any existing filesystem. It may work
by accident today on ext4 with a pre-allocated file, but a filesystem
is otherwise permitted to drop any writes that have not been synced.
Until we get an explicit MMAP_SYNC or METADATA_IMMUTABLE feature into
a filesystem the only interface that we can use to reliably pass
persistent memory through to a guest is device-dax.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-01 13:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20170526023213.18741-1-haozhong.zhang@intel.com>
[not found] ` <14af6adf-9076-1368-75bb-8001ed667150@gmail.com>
2017-06-01 13:53 ` [RESEND PATCH 1/2] nvdimm: warn if the backend is not a DAX device Dan Williams
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).