summaryrefslogtreecommitdiffstats
path: root/fs/udf
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-04-07 17:28:12 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2015-04-12 04:29:47 +0200
commit5f380c7fa7e01f15ca0816bd241ece9a64a73192 (patch)
tree2136f54098eb85d21d17ee43f73724a5befd70a1 /fs/udf
parent__generic_file_write_iter: keep ->ki_pos and return value consistent (diff)
downloadlinux-5f380c7fa7e01f15ca0816bd241ece9a64a73192.tar.xz
linux-5f380c7fa7e01f15ca0816bd241ece9a64a73192.zip
lift generic_write_checks() into callers of __generic_file_write_iter()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/udf')
-rw-r--r--fs/udf/file.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/udf/file.c b/fs/udf/file.c
index 78d42548b260..35e81ed99405 100644
--- a/fs/udf/file.c
+++ b/fs/udf/file.c
@@ -151,7 +151,17 @@ static ssize_t udf_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
} else
up_write(&iinfo->i_data_sem);
+ retval = generic_write_checks(file, &iocb->ki_pos, &count, 0);
+ if (retval)
+ goto out;
+
+ if (count == 0)
+ goto out;
+
+ iov_iter_truncate(from, count);
+
retval = __generic_file_write_iter(iocb, from);
+out:
mutex_unlock(&inode->i_mutex);
if (retval > 0) {