Bug 244848 - SIlent truncation of files when NFS quota reached
Summary: SIlent truncation of files when NFS quota reached
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: samba
Version: 4.5
Hardware: All
OS: Linux
low
high
Target Milestone: ---
: ---
Assignee: Guenther Deschner
QA Contact: qe-baseos-daemons
URL: http://www.mail-archive.com/samba@lis...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-06-19 14:08 UTC by David Losada
Modified: 2010-05-10 14:43 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-05-10 14:43:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Check errors returned by fsync call (6.14 KB, patch)
2007-06-19 14:08 UTC, David Losada
no flags Details | Diff
Jeremy's patch adapted by me, for 3.0.10-1.4E.12.2 (6.76 KB, patch)
2007-06-19 14:12 UTC, David Losada
no flags Details | Diff

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


Note You need to log in before you can comment on or make changes to this bug.