Bug 1469 - lacking the last part of a file, writing to a NFS file sytem.
Summary: lacking the last part of a file, writing to a NFS file sytem.
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: File Services (show other bugs)
Version: 3.0.4
Hardware: x86 FreeBSD
: P3 major
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-20 22:02 UTC by YABUUCHI Kenji
Modified: 2006-04-08 22:46 UTC (History)
0 users

See Also:


Attachments
Check fsync() return value to indicate an error (samba-3.0.4) (6.23 KB, patch)
2004-06-20 23:03 UTC, YABUUCHI Kenji
no flags Details
for samba-2.2.9 (6.98 KB, patch)
2004-06-20 23:27 UTC, YABUUCHI Kenji
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description YABUUCHI Kenji 2004-06-20 22:02:31 UTC
I'm using samba-3.0.4 and samba-2.2.9 on FreeBSD-4-stable and FreeBSD-current.

I define a resouce on a NFS mounted file system.  When I try to write more
bytes than quota entry on NFS server permits, the first write() always succeed 
even if it should fail. I know this is normal on a network file system, but 
the following error on close() is ignored, so that corrupted, lacking the last
part, file is left with no error on client(windows) if the last write() of a
transaction raised an error. 

I set 'strict sync' and 'sync always' in smb.conf, though it has no effect. 
Because they result in calling sync_file() in reply_write_and_X() in reply.c, 
but the return value of sync_file() is never checked. 

I modified reply_write_and_X() to check the return value of sync_file() to 
report an error and the problem is fixed (at least on FreeBSD). I modified
the other part of reply.c, but not tested yet.

FYI, Fedora Core2 report an error on a first write (not second) on a NFS 
filesystem, so this problem does not occur.
Comment 1 YABUUCHI Kenji 2004-06-20 23:03:54 UTC
Created attachment 544 [details]
Check fsync() return value to indicate an error (samba-3.0.4)
Comment 2 YABUUCHI Kenji 2004-06-20 23:27:00 UTC
Created attachment 545 [details]
for samba-2.2.9
Comment 3 Gerald (Jerry) Carter (dead mail address) 2006-04-08 22:46:48 UTC
Please retest against a current release and reopen if the issue still exists.