summaryrefslogtreecommitdiffstats
path: root/mm/filemap.c
diff options
context:
space:
mode:
authorJiri Slaby2010-03-05 22:41:44 +0100
committerLinus Torvalds2010-03-06 20:26:24 +0100
commit59e99e5b9706867f18d4a36c1e4645fbaacbec2e (patch)
treee977fb5eecccf1446296fd196072bd1287b0a92f /mm/filemap.c
parentmm: mlock_vma_pages_range() only return success or failure (diff)
downloadkernel-qcow2-linux-59e99e5b9706867f18d4a36c1e4645fbaacbec2e.tar.gz
kernel-qcow2-linux-59e99e5b9706867f18d4a36c1e4645fbaacbec2e.tar.xz
kernel-qcow2-linux-59e99e5b9706867f18d4a36c1e4645fbaacbec2e.zip
mm: use rlimit helpers
Make sure compiler won't do weird things with limits. E.g. fetching them twice may return 2 different values after writable limits are implemented. I.e. either use rlimit helpers added in 3e10e716abf3c71bdb5d86b8f507f9e72236c9cd ("resource: add helpers for fetching rlimits") or ACCESS_ONCE if not applicable. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/filemap.c')
-rw-r--r--mm/filemap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 148b52a5bb7e..045b31c37653 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1986,7 +1986,7 @@ EXPORT_SYMBOL(iov_iter_single_seg_count);
inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk)
{
struct inode *inode = file->f_mapping->host;
- unsigned long limit = current->signal->rlim[RLIMIT_FSIZE].rlim_cur;
+ unsigned long limit = rlimit(RLIMIT_FSIZE);
if (unlikely(*pos < 0))
return -EINVAL;