Bug 244848

Summary: SIlent truncation of files when NFS quota reached
Product: Red Hat Enterprise Linux 4 Reporter: David Losada <david.losada>
Component: sambaAssignee: Guenther Deschner <gdeschner>
Status: CLOSED CURRENTRELEASE QA Contact: qe-baseos-daemons
Severity: high Docs Contact:
Priority: low    
Version: 4.5CC: dpal, gdeschner, jplans
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://www.mail-archive.com/samba@lists.samba.org/msg85448.html
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-05-10 14:43:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Check errors returned by fsync call
none
Jeremy's patch adapted by me, for 3.0.10-1.4E.12.2 none

Description David Losada 2007-06-19 14:08:57 UTC
Description of problem:
When serving files from an NFS export with quotas enabled, the "quota full"
error is not propagated to windows clients at a moment when they are willing to
let the user know. The result is that users will have their files truncated
without notice.


Version-Release number of selected component (if applicable):
3.0.10-1.4E.12.2


How reproducible:
On a samba share based on any quota-limited NFS exported file system (reproduced
both with Solaris NFS server and Linux NFS server)


Steps to Reproduce:
1. From a Windows 2000 client, fill up the share with a total file size that
exceeds quota
2.
3.
  
Actual results:
Files are left in the share, truncated with size 0, user doesn't receive an
error message.

Expected results:
Files shouldn't be left truncated on the share, user should receive an error
message.

Additional info:
Jeremy Allison <jra> acknowledged the problem and produced the patch
I'm attaching. The patch makes samba check the errors that might be returned by
the fsync call. It applies to 3.0.25c

By activating the "strict sync" and "sync always" smb.conf directives, Samba
syncs the file while it's being written, thus being able to report the quota
error at that moment. This is a good moment for Windows to acknowledge the
error. (on close(), it's too late)

Comment 1 David Losada 2007-06-19 14:08:58 UTC
Created attachment 157370 [details]
Check errors returned by fsync call

Comment 2 David Losada 2007-06-19 14:12:09 UTC
Created attachment 157371 [details]
Jeremy's patch adapted by me, for 3.0.10-1.4E.12.2