summaryrefslogtreecommitdiffstats
path: root/fs/udf
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-04-07 11:28:12 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-04-11 22:29:47 -0400
commit5f380c7fa7e01f15ca0816bd241ece9a64a73192 (patch)
tree2136f54098eb85d21d17ee43f73724a5befd70a1 /fs/udf
parent0b8def9d6dfa6b2a9a2740cf81d8d2c134688d39 (diff)
downloadlinux-5f380c7fa7e01f15ca0816bd241ece9a64a73192.tar.bz2
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) {