Skip to contentSkip to conversation

ocfs2: send SIGXFSZ if new filesize exceeds limit -v2

PATCH New Wengang Wang 2 participants 2 messages Feb 26, 2010 – Feb 28, 2010 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocfs2: send SIGXFSZ if new filesize exceeds limit -v2

This patch makes ocfs2 send SIGXFSZ if new file size exceeds limit and abort the operation.
No suprise that processes get SIGXFSZ on one node(in the cluster) while they don't on another if file size limits are different on the two nodes.

---
 fs/ocfs2/file.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
fs/ocfs2/file.c +2 -3
index 558ce03..a118cb0 100644
@@ -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)) {
Signature · 1 line
1.6.6
#1 lore raw

PATCH 1/1 ocfs2: send SIGXFSZ if new filesize exceeds limit -v2

Quoted 6 lines · Wengang Wang

This patch makes ocfs2 send SIGXFSZ if new file size exceeds limit and abort the operation.
No suprise that processes get SIGXFSZ on one node(in the cluster) while they don't on another if file size limits are different on the two nodes.

This patch is now in the 'merge-window' branch of ocfs2.git.

Joel

Signature · 8 lines
"A narcissist is someone better looking than you are."  
         - Gore Vidal

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127