Skip to content

Commit 17973f5

Browse files
micahcowanLinus Torvalds
authored andcommitted
Only send SIGXFSZ when exceeding rlimits.
Some users have been having problems with utilities like cp or dd dumping core when they try to copy a file that's too large for the destination filesystem (typically, > 4gb). Apparently, some defunct standards required SIGXFSZ to be sent in such circumstances, but SUS only requires/allows it for when a written file exceeds the process's resource limits. I'd like to limit SIGXFSZs to the bare minimum required by SUS. Patch sent per http://lkml.org/lkml/2007/4/10/302 Signed-off-by: Micah Cowan <micahcowan@ubuntu.com> Acked-by: Alan Cox <alan@redhat.com> Cc: <reiserfs-dev@namesys.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 1e3e8d9 commit 17973f5

File tree

3 files changed

+0
-5
lines changed

3 files changed

+0
-5
lines changed

fs/ncpfs/file.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t *
203203

204204
if (pos + count > MAX_NON_LFS && !(file->f_flags&O_LARGEFILE)) {
205205
if (pos >= MAX_NON_LFS) {
206-
send_sig(SIGXFSZ, current, 0);
207206
return -EFBIG;
208207
}
209208
if (count > MAX_NON_LFS - (u32)pos) {
@@ -212,7 +211,6 @@ ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t *
212211
}
213212
if (pos >= inode->i_sb->s_maxbytes) {
214213
if (count || pos > inode->i_sb->s_maxbytes) {
215-
send_sig(SIGXFSZ, current, 0);
216214
return -EFBIG;
217215
}
218216
}

fs/reiserfs/file.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,6 @@ static ssize_t reiserfs_file_write(struct file *file, /* the file we are going t
13051305
if (get_inode_item_key_version (inode) == KEY_FORMAT_3_5 &&
13061306
*ppos + count > MAX_NON_LFS) {
13071307
if (*ppos >= MAX_NON_LFS) {
1308-
send_sig(SIGXFSZ, current, 0);
13091308
return -EFBIG;
13101309
}
13111310
if (count > MAX_NON_LFS - (unsigned long)*ppos)

mm/filemap.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1967,7 +1967,6 @@ inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, i
19671967
if (unlikely(*pos + *count > MAX_NON_LFS &&
19681968
!(file->f_flags & O_LARGEFILE))) {
19691969
if (*pos >= MAX_NON_LFS) {
1970-
send_sig(SIGXFSZ, current, 0);
19711970
return -EFBIG;
19721971
}
19731972
if (*count > MAX_NON_LFS - (unsigned long)*pos) {
@@ -1985,7 +1984,6 @@ inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, i
19851984
if (likely(!isblk)) {
19861985
if (unlikely(*pos >= inode->i_sb->s_maxbytes)) {
19871986
if (*count || *pos > inode->i_sb->s_maxbytes) {
1988-
send_sig(SIGXFSZ, current, 0);
19891987
return -EFBIG;
19901988
}
19911989
/* zero-length writes at ->s_maxbytes are OK */

0 commit comments

Comments
 (0)