1 From ef8423022324cf79bd1b41d8707c766461e7e555 Mon Sep 17 00:00:00 2001
2 From: Dave Jiang <dave.jiang@intel.com>
3 Date: Thu, 19 Apr 2018 13:39:43 -0700
4 Subject: device-dax: allow MAP_SYNC to succeed
6 From: Dave Jiang <dave.jiang@intel.com>
8 commit ef8423022324cf79bd1b41d8707c766461e7e555 upstream.
10 MAP_SYNC is a nop for device-dax. Allow MAP_SYNC to succeed on device-dax
11 to eliminate special casing between device-dax and fs-dax as to when the
12 flag can be specified. Device-dax users already implicitly assume that they do
13 not need to call fsync(), and this enables them to explicitly check for this
16 Cc: <stable@vger.kernel.org>
17 Fixes: b6fb293f2497 ("mm: Define MAP_SYNC and VM_SYNC flags")
18 Signed-off-by: Dave Jiang <dave.jiang@intel.com>
19 Reviewed-by: Dan Williams <dan.j.williams@intel.com>
20 Signed-off-by: Dan Williams <dan.j.williams@intel.com>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24 drivers/dax/device.c | 2 ++
25 1 file changed, 2 insertions(+)
27 --- a/drivers/dax/device.c
28 +++ b/drivers/dax/device.c
30 #include <linux/dax.h>
33 +#include <linux/mman.h>
34 #include "dax-private.h"
37 @@ -534,6 +535,7 @@ static const struct file_operations dax_
38 .release = dax_release,
39 .get_unmapped_area = dax_get_unmapped_area,
41 + .mmap_supported_flags = MAP_SYNC,
44 static void dev_dax_release(struct device *dev)