Whamcloud - gitweb
LU-808 llite: deny truncate beyond user rlimit
authorAndreas Dilger <adilger@whamcloud.com>
Mon, 31 Oct 2011 20:14:27 +0000 (14:14 -0600)
committerOleg Drokin <green@whamcloud.com>
Thu, 29 Mar 2012 04:05:56 +0000 (00:05 -0400)
commita44174684d800d74d35d9eb0b1b65bcfd0dd8163
treec83d15d94944fd3486401e80b523ddfc3f6b6d58
parentd016a086b68ca4af2dcbfefc3917b9291efd8d62
LU-808 llite: deny truncate beyond user rlimit

Add a call to inode_newsize_ok() in ll_setattr_raw() to ensure
that the file is not truncated beyond the VFS/VM maximum limits
or the user maximum file size, as set by rlimit.

Replace the PAGE_CACHE_MAXBYTES constant with MAX_LFS_FILESIZE,
which is already defined by the VFS.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I6b4f03820dd59d6b1c3429e9bbfea62c50206cc9
Reviewed-on: http://review.whamcloud.com/1635
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_lite.h
lustre/liblustre/llite_lib.h
lustre/liblustre/super.c
lustre/llite/llite_lib.c
lustre/obdclass/obd_mount.c