aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorMicah Cowan <micah@cowan.name>2007-07-16 02:40:08 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-16 12:05:43 -0400
commit17973f5af741f1758ed57c5115ca394c22bee159 (patch)
tree0fd340e46f1fbae4ab7aa8d06b26af208a3e83f4 /mm
parent1e3e8d91fee56e1ab598b265466dc38033f1b915 (diff)
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>
Diffstat (limited to 'mm')
-rw-r--r--mm/filemap.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index adbac104f34c..100b99c2d504 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1967,7 +1967,6 @@ inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, i
1967 if (unlikely(*pos + *count > MAX_NON_LFS && 1967 if (unlikely(*pos + *count > MAX_NON_LFS &&
1968 !(file->f_flags & O_LARGEFILE))) { 1968 !(file->f_flags & O_LARGEFILE))) {
1969 if (*pos >= MAX_NON_LFS) { 1969 if (*pos >= MAX_NON_LFS) {
1970 send_sig(SIGXFSZ, current, 0);
1971 return -EFBIG; 1970 return -EFBIG;
1972 } 1971 }
1973 if (*count > MAX_NON_LFS - (unsigned long)*pos) { 1972 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
1985 if (likely(!isblk)) { 1984 if (likely(!isblk)) {
1986 if (unlikely(*pos >= inode->i_sb->s_maxbytes)) { 1985 if (unlikely(*pos >= inode->i_sb->s_maxbytes)) {
1987 if (*count || *pos > inode->i_sb->s_maxbytes) { 1986 if (*count || *pos > inode->i_sb->s_maxbytes) {
1988 send_sig(SIGXFSZ, current, 0);
1989 return -EFBIG; 1987 return -EFBIG;
1990 } 1988 }
1991 /* zero-length writes at ->s_maxbytes are OK */ 1989 /* zero-length writes at ->s_maxbytes are OK */