Skip to contentSkip to conversation

Initialize count in aio_write before generic_write_checks

Ocfs2-devel Goldwyn Rodrigues 3 participants 3 messages Jul 11, 2009 – Jul 21, 2009 OCFS2

lore
Share & tools
lore
#0 lore raw

generic_write_checks() expects count to be initialized to the size of the write.
Writes to files open with O_DIRECT|O_LARGEFILE write 0 bytes because count in uninitialized.

fs/ocfs2/file.c +1 -0
index a5887df..5b9c8af 100644
@@ -1841,6 +1841,7 @@ relock:
 		if (ret)
 			goto out_dio;
 
+		count = ocount;
 		ret = generic_write_checks(file, ppos, &count,
 					   S_ISBLK(inode->i_mode));
 		if (ret)
Signature · 1 line
Goldwyn
#1 lore raw
Quoted 7 lines · Goldwyn Rodrigues

generic_write_checks() expects count to be initialized to the size of the write.
Writes to files open with O_DIRECT|O_LARGEFILE write 0 bytes because count in uninitialized.

Quoted 14 lines
fs/ocfs2/file.c +1 -0
index a5887df..5b9c8af 100644
@@ -1841,6 +1841,7 @@ relock:
 		if (ret)
 			goto out_dio;
 
+		count = ocount;
 		ret = generic_write_checks(file, ppos, &count,
 					   S_ISBLK(inode->i_mode));
 		if (ret)
#2 lore raw
In reply to Goldwyn Rodrigues
Quoted 6 lines · Goldwyn Rodrigues

generic_write_checks() expects count to be initialized to the size of the write.
Writes to files open with O_DIRECT|O_LARGEFILE write 0 bytes because count in uninitialized.

This is now in the fixes branch of ocfs2.git

Joel

Signature · 9 lines
Life's Little Instruction Book #237

	"Seek out the good in people."

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