* [PATCH 0/2] Fix some return value truncation problems on file writes.
@ 2004-09-15 19:19 Robin Holt
2004-09-15 19:22 ` [PATCH 1/2] Fix write() return values for tmpfs Robin Holt
2004-09-15 19:24 ` [PATCH 2/2] Fix write() return values for reiserfs Robin Holt
0 siblings, 2 replies; 3+ messages in thread
From: Robin Holt @ 2004-09-15 19:19 UTC (permalink / raw)
To: linux-kernel
During some testing, it was noted that writing more than 2GB using
fwrite() to a file on tmpfs would continue to retry the write()
syscall until the entire filesystem was full. I was then encouraged
to verify XFS, ext2, ext3, reiserfs, and pipe. The only other
problem noted was from reiserfs with direct I/O. I did not test
the direct I/O code change.
Thanks,
Robin Holt
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] Fix write() return values for tmpfs.
2004-09-15 19:19 [PATCH 0/2] Fix some return value truncation problems on file writes Robin Holt
@ 2004-09-15 19:22 ` Robin Holt
2004-09-15 19:24 ` [PATCH 2/2] Fix write() return values for reiserfs Robin Holt
1 sibling, 0 replies; 3+ messages in thread
From: Robin Holt @ 2004-09-15 19:22 UTC (permalink / raw)
To: linux-kernel
This patch makes the return from the write() syscall actually an ssize_t
instead of an int.
Signed-off-by: Robin Holt <holt@sgi.com>
Index: linux-2.6/mm/shmem.c
===================================================================
--- linux-2.6.orig/mm/shmem.c 2004-09-14 14:40:06.000000000 -0500
+++ linux-2.6/mm/shmem.c 2004-09-14 14:54:38.000000000 -0500
@@ -1301,7 +1301,7 @@
struct inode *inode = file->f_dentry->d_inode;
loff_t pos;
unsigned long written;
- int err;
+ ssize_t err;
if ((ssize_t) count < 0)
return -EINVAL;
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] Fix write() return values for reiserfs.
2004-09-15 19:19 [PATCH 0/2] Fix some return value truncation problems on file writes Robin Holt
2004-09-15 19:22 ` [PATCH 1/2] Fix write() return values for tmpfs Robin Holt
@ 2004-09-15 19:24 ` Robin Holt
1 sibling, 0 replies; 3+ messages in thread
From: Robin Holt @ 2004-09-15 19:24 UTC (permalink / raw)
To: linux-kernel, resierfs-dev
This patch fixes the direct I/O return value for reiserfs writes
to be ssize_t instead of int.
Signed-off-by: Robin Holt <holt@sgi.com>
Index: linux-2.6/fs/reiserfs/file.c
===================================================================
--- linux-2.6.orig/fs/reiserfs/file.c 2004-09-14 14:39:37.000000000 -0500
+++ linux-2.6/fs/reiserfs/file.c 2004-09-15 12:42:41.000000000 -0500
@@ -1099,7 +1099,7 @@
{
size_t already_written = 0; // Number of bytes already written to the file.
loff_t pos; // Current position in the file.
- size_t res; // return value of various functions that we call.
+ ssize_t res; // return value of various functions that we call.
struct inode *inode = file->f_dentry->d_inode; // Inode of the file that we are writing to.
/* To simplify coding at this time, we store
locked pages in array for now */
@@ -1108,7 +1108,7 @@
th.t_trans_id = 0;
if ( file->f_flags & O_DIRECT) { // Direct IO needs treatment
- int result, after_file_end = 0;
+ ssize_t result, after_file_end = 0;
if ( (*ppos + count >= inode->i_size) || (file->f_flags & O_APPEND) ) {
/* If we are appending a file, we need to put this savelink in here.
If we will crash while doing direct io, finish_unfinished will
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-09-15 19:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-15 19:19 [PATCH 0/2] Fix some return value truncation problems on file writes Robin Holt
2004-09-15 19:22 ` [PATCH 1/2] Fix write() return values for tmpfs Robin Holt
2004-09-15 19:24 ` [PATCH 2/2] Fix write() return values for reiserfs Robin Holt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).