All of lore.kernel.org
 help / color / mirror / Atom feed
From: Micah Cowan <micah@cowan.name>
To: linux-kernel@vger.kernel.org
Subject: Re: Use of SIGXFSZ outside of soft limits
Date: Sun, 20 May 2007 16:04:41 -0700	[thread overview]
Message-ID: <4650D409.7090400@cowan.name> (raw)
In-Reply-To: <461C04E5.4090809@cowan.name>

Micah Cowan wrote:
> Alan Cox wrote:
>>> [XSI] [Option Start] If the request would cause the file size to
>>> exceed the soft file size limit for the process and there is no room
>>> for any bytes to be written, the request shall fail and the
>>> implementation shall generate the SIGXFSZ signal for the thread.
>>> [Option End]
>>>  >>>
>>
>> This all depends which document and version you review. AIX for example
>> has or had the same behaviour as Linux which comes from the Large File
>> Summit and indeed our implementation was carefully tested to pass the
>> test suite of the time.
>>
>> SUSv3 seems to subsume the older LFS standards, and has adjusted them
>> somewhat in the merging so there may well be a good case for normalizing
>> our behaviour to match SUSv3. Run some tests and send patches.
>>
>> Alan
> 
> Thanks very much for this response, Alan.
> 
> I kind of suspected it might be something like this. I'm relieved to
> know that the original reasons for signaling that on other cases may no
> longer apply.
> 
> I'll plan to be back with patches, then! :)
> 
> -Micah
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

Sorry it's taken this long. The patch seems to work well, and the changes are _quite_ trivial.

diff -ru linux-2.6.20.6-orig/fs/ncpfs/file.c linux-2.6.20.6/fs/ncpfs/file.c
--- linux-2.6.20.6-orig/fs/ncpfs/file.c	2007-04-06 13:02:48.000000000 -0700
+++ linux-2.6.20.6/fs/ncpfs/file.c	2007-04-14 11:16:56.000000000 -0700
@@ -203,7 +203,6 @@

 	if (pos + count > MAX_NON_LFS && !(file->f_flags&O_LARGEFILE)) {
 		if (pos >= MAX_NON_LFS) {
-			send_sig(SIGXFSZ, current, 0);
 			return -EFBIG;
 		}
 		if (count > MAX_NON_LFS - (u32)pos) {
@@ -212,7 +211,6 @@
 	}
 	if (pos >= inode->i_sb->s_maxbytes) {
 		if (count || pos > inode->i_sb->s_maxbytes) {
-			send_sig(SIGXFSZ, current, 0);
 			return -EFBIG;
 		}
 	}
diff -ru linux-2.6.20.6-orig/fs/reiserfs/file.c linux-2.6.20.6/fs/reiserfs/file.c
--- linux-2.6.20.6-orig/fs/reiserfs/file.c	2007-04-06 13:02:48.000000000 -0700
+++ linux-2.6.20.6/fs/reiserfs/file.c	2007-04-14 11:17:46.000000000 -0700
@@ -1323,7 +1323,6 @@
 	if (get_inode_item_key_version (inode) == KEY_FORMAT_3_5 &&
 	    *ppos + count > MAX_NON_LFS) {
 		if (*ppos >= MAX_NON_LFS) {
-			send_sig(SIGXFSZ, current, 0);
 			return -EFBIG;
 		}
 		if (count > MAX_NON_LFS - (unsigned long)*ppos)
diff -ru linux-2.6.20.6-orig/mm/filemap.c linux-2.6.20.6/mm/filemap.c
--- linux-2.6.20.6-orig/mm/filemap.c	2007-04-06 13:02:48.000000000 -0700
+++ linux-2.6.20.6/mm/filemap.c	2007-04-14 11:14:20.000000000 -0700
@@ -1971,7 +1971,6 @@
 	if (unlikely(*pos + *count > MAX_NON_LFS &&
 				!(file->f_flags & O_LARGEFILE))) {
 		if (*pos >= MAX_NON_LFS) {
-			send_sig(SIGXFSZ, current, 0);
 			return -EFBIG;
 		}
 		if (*count > MAX_NON_LFS - (unsigned long)*pos) {
@@ -1989,7 +1988,6 @@
 	if (likely(!isblk)) {
 		if (unlikely(*pos >= inode->i_sb->s_maxbytes)) {
 			if (*count || *pos > inode->i_sb->s_maxbytes) {
-				send_sig(SIGXFSZ, current, 0);
 				return -EFBIG;
 			}
 			/* zero-length writes at ->s_maxbytes are OK */

      reply	other threads:[~2007-05-20 23:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-10 20:20 Use of SIGXFSZ outside of soft limits Micah Cowan
2007-04-10 21:38 ` Alan Cox
2007-04-10 21:43   ` Micah Cowan
2007-05-20 23:04     ` Micah Cowan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4650D409.7090400@cowan.name \
    --to=micah@cowan.name \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.