aboutsummaryrefslogtreecommitdiffstats
path: root/fs/attr.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2010-03-05 16:42:42 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-06 14:26:29 -0500
commitd554ed895dc8f293cc712c71f14b101ace82579a (patch)
treefd29ba33d640e156e2ca4267ffbdb9dc566fd3d6 /fs/attr.c
parent221e3ebf6d5f2625373573155924e39f196c5d3d (diff)
fs: 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 commit 3e10e716abf3 ("resource: add helpers for fetching rlimits") or ACCESS_ONCE if not applicable. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/attr.c')
-rw-r--r--fs/attr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/attr.c b/fs/attr.c
index 0a6ea54cde7d..0815e93bb487 100644
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -81,7 +81,7 @@ int inode_newsize_ok(const struct inode *inode, loff_t offset)
81 if (inode->i_size < offset) { 81 if (inode->i_size < offset) {
82 unsigned long limit; 82 unsigned long limit;
83 83
84 limit = current->signal->rlim[RLIMIT_FSIZE].rlim_cur; 84 limit = rlimit(RLIMIT_FSIZE);
85 if (limit != RLIM_INFINITY && offset > limit) 85 if (limit != RLIM_INFINITY && offset > limit)
86 goto out_sig; 86 goto out_sig;
87 if (offset > inode->i_sb->s_maxbytes) 87 if (offset > inode->i_sb->s_maxbytes)