]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ocfs2: send SIGXFSZ if new filesize exceeds limit -v2
authorWengang Wang <wen.gang.wang@oracle.com>
Fri, 26 Feb 2010 10:18:25 +0000 (18:18 +0800)
committerJoel Becker <joel.becker@oracle.com>
Sun, 28 Feb 2010 04:08:51 +0000 (20:08 -0800)
This patch makes ocfs2 send SIGXFSZ if new file size exceeds the rlimit.
Processes may get SIGXFSZ on one node (in the cluster) while others will
not on another if file size limits are different on the two nodes.

Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
fs/ocfs2/file.c

index c8a4a2939e550ef43f81f278996111cddc6506a2..5b52547d6299e75b673dda19d89e160c5cb429d2 100644 (file)
@@ -993,10 +993,9 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
        }
 
        if (size_change && attr->ia_size != i_size_read(inode)) {
-               if (attr->ia_size > sb->s_maxbytes) {
-                       status = -EFBIG;
+               status = inode_newsize_ok(inode, attr->ia_size);
+               if (status)
                        goto bail_unlock;
-               }
 
                if (i_size_read(inode) > attr->ia_size) {
                        if (ocfs2_should_order_data(inode)) {