Mark,
> We're running PVFS2 (1.3.2); metadata servers and storage
> nodes are x86 systems; the PVFS clients are Opteron-based
> systems from HP, runing SuSE SLES9.
>
> Somebody reported problems appending to a file which lived
> in the /pvfs hierarchy, using the shell's ">>" redirection
> of standard output; the file contents were garbled.
>
> So in this last one, it appears that the file pointer gets
> set back to the beginning of the file on each write() call
> (but only if the file attached to that file descriptor is
> in the /pvfs hierarchy).
PVFS2 1.3.2 had an append bug that has been fixed subsequently. The
attached minimal patch (for 1.3.2) should hopefully fix the issue that
you noticed on the older kernels.. (or upgrading to a later release should
fix the issue). If it does not get fixed, please do let us know.
>
> However ... Although this problem is solidly reproducible
> on systems running the 2.6.5-7.201-smp kernel, it _doesn't_
> happen on systems running the 2.6.13-15.7-smp kernel.
>
> So I'm a bit baffled: This certainly seems like a PVFS bug
> (since the problem happens only when the file being opened
> in "append" mode is on a PVFS filesystem; everything is OK
> on locally-mounted filesystems and NFS-mounted filesystems).
>
> But if it's a PVFS bug, then why does the problem disappear
> with the newer kernel? Are there two independent bugs (one
> each in the 2.6.5-7.201-smp kernel and in the PVFS2 client
> code), _both_ of which need to be present for this problem
> to happen?
Hmm.. No clue. The checks that we had in 1.3.2 were certainly not correct.
I dont see any difference in the code between kernel 2.6.5-.., 2.6.13 that
would help explain what you are seeing. Sorry..
Thanks
Murali
diff -uraN pvfs2-1.3.2/src/kernel/linux-2.6/file.c
pvfs2-new/src/kernel/linux-2.6/file.c
--- pvfs2-1.3.2/src/kernel/linux-2.6/file.c 2005-12-02 09:55:49.000000000
-0600
+++ pvfs2-new/src/kernel/linux-2.6/file.c 2006-03-06 15:11:58.000000000
-0600
@@ -281,6 +281,11 @@
if (!access_ok(VERIFY_READ, buf, count))
return -EFAULT;
+ if(file->f_pos > i_size_read(inode))
+ {
+ i_size_write(inode, file->f_pos);
+ }
+
/* perform generic linux kernel tests for sanity of write arguments */
/* NOTE: this is particularly helpful in handling fsize rlimit properly */
#ifdef PVFS2_LINUX_KERNEL_2_4
@@ -293,15 +298,9 @@
pvfs2_print("pvfs2_file_write: failed generic argument checks.\n");
return(ret);
}
- /* for whatever reason, count is being set to inode->i_size in
- * generic_write_checks with O_APPEND opens. So if we want that to work,
- * we would have to do a getattr for the size which is ridiculous.
- * So we work that around here...
- */
- if (*offset != file->f_pos)
- {
- *offset = file->f_pos;
- }
+
+ pvfs2_print("pvfs2_file_write: proceeding with offset : %ld, size %ld\n",
+ (unsigned long) *offset, (unsigned long) count);
while(total_count < count)
{
_______________________________________________
Pvfs2-users mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users