From 865ffef3797da2cac85b3354b5b6050dc9660978 Mon Sep 17 00:00:00 2001 From: Dmitry Monakhov Date: Mon, 29 Apr 2013 15:08:42 -0700 Subject: [PATCH] fs: fix fsync() error reporting There are two convenient ways to report errors to userspace 1) retun error to original syscall for example write(2) 2) mark mapping with error flag and return it on later fsync(2) Second one is broken if (mapping->nrpages == 0) This is real-life situation because after error pages are likey to be truncated or invalidated. We have to return an error regardless to number of pages in the mapping. #Original testcase: git@github.com:dmonakhov/xfstests.git MOUNT_OPTIONS="-b1024" ./check shared/305 Signed-off-by: Dmitry Monakhov Reviewed-by: Jan Kara Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-format-patch failed