staging/lustre/ost: Ensure dirty flushed on fiemap ioctl
authorArtem Blagodarenko <artem_blagodarenko@xyratex.com>
Mon, 3 Jun 2013 13:40:53 +0000 (21:40 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Jun 2013 18:26:36 +0000 (11:26 -0700)
commit9d8654397d0dcb1885457a2188b59995f2219676
treedd0cfb6e65179877f78f47603be0935a18cec1d9
parente377988ed83ebbd871cea36ef5cf47f2360b7bfc
staging/lustre/ost: Ensure dirty flushed on fiemap ioctl

Data corruption is possible if cp(coreutils) uses FIEMAP to obtain
data holes in shared file, since there could be dirty cache on
other clients which hasn't been flushed back.

To ensure all the dirty on remote clients being flushed back on
fiemap ioctl, we'd acquire ldlm lock on server side for fiemap,
unless the local client (which invoke fiemap) has cached lock.

[picked osc part for upstream kernel submission]
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3219
Xyratex-bug-id: MRP-1001
Lustre-change: http://review.whamcloud.com/6127
Signed-off-by: Artem Blagodarenko <artem_blagodarenko@xyratex.com>
Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/osc/osc_request.c