Johannes Niess
2003-Jul-21 13:11 UTC
[Samba] silent file truncation on ext3 with linux quota v0
The following message is a courtesy copy of an article that has been posted to comp.protocols.smb as well. Hi, I'm trying to implement file system quotas on a Debian Woody Linux box. My problem is that W2k Explorer silently truncates files when going over quota by copying files. Other applications work as expected and show a "disk full" error message. To me it looks like the error code for "over quota" is not propagated back from samba to Windows Explorer. I've tried with all combinations of Linux kernel 2.4.18, latest 2.4-ac, samba-2.2.3a-12 (from woody) and a debian source package 2.2.8a reconfigured --with-quota. I've not yet used a newer quota package. I've found some descriptions of the problem, but no workaround. I understand that samba supports only v2 version quotas (from the -ac kernel series and maybe latest 2.4-marcelo's-pre). I'm not asking for support of network drives size set to quotas. A "dfree command" can easily do that. BTW: What's the status of quota support in Samba 3? What I really want are quotas per samba share, independend of the OS. Thank you very much. Johannes Nie?
Johannes Niess
2003-Jul-23 18:18 UTC
[Samba] silent file truncation on ext3 with linux quota v0
Johannes Niess <j.niess@uni-bonn.de> writes:> The following message is a courtesy copy of an article > that has been posted to comp.protocols.smb as well. > > Hi, > > I'm trying to implement file system quotas on a Debian Woody Linux > box. My problem is that W2k Explorer silently truncates files when > going over quota by copying files. Other applications work as > expected and show a "disk full" error message. > > To me it looks like the error code for "over quota" is not propagated > back from samba to Windows Explorer. > > I've tried with all combinations of Linux kernel 2.4.18, latest > 2.4-ac, samba-2.2.3a-12 (from woody) and a debian source package > 2.2.8a reconfigured --with-quota. I've not yet used a newer quota > package. > > I've found some descriptions of the problem, but no workaround. I > understand that samba supports only v2 version quotas (from the -ac > kernel series and maybe latest 2.4-marcelo's-pre). I'm not asking for > support of network drives size set to quotas. A "dfree command" can > easily do that. > > BTW: What's the status of quota support in Samba 3? What I really want > are quotas per samba share, independend of the OS.It happpens with _all_ devices. Even setting "strict allocate = yes" does not stop the creation of sparse files. Steven Langasek explained it in Debian-Bug 202396: On Tue, Jul 22, 2003 at 11:17:35AM +0200, Johannes Niess wrote:> something seems terribly wrong with disk full error handling. Howto > reproduce:> 1) mke2fs /dev/fd0 (with a 1.44 MB floppy) > 2) mount /floppy > 3) create writeabe [floppy] share in smb.conf: > [floppy] > path = /floppy > writable = yes > force user = root ; to shortcut problems with user mount options> 4) use Windows 200 explorer to copy a 2MB file to [floppy] share > 4) No error message on windows client. File truncation for file > exceeding disk size. Zero byte length for following files.> Behavior seen from client varies with file system used: > ext2 shows full lenght under windows and linux. > vfat shows truncated length.> I'm afraid that this happens on "real" shares, too.There is a fundamental disconnect due to the Unix concept of "sparse files" (something Windows lacks). Windows applications sometimes open a file for writing, seek to the "end" and write a byte as a means of checking whether space is available for the whole file, and then never do any more error checking for the duration of the file write. This works passing well when the server is a Windows machine; when the server is a Unix machine, it's possible to have a file whose total length is greater than the available storage size, since unwritten blocks of zeroes in the middle of a file don't use space on the disk. You can find further discussion of this problem in the archives of the samba-technical mailing list. I think there may be a fix for this in Samba 3.0; but even if there isn't, I don't intend to deviate from the upstream source to correct what is, ultimately, a *client* bug (since AFAIK it's Windows, not Samba, which is failing t
John H Terpstra
2003-Jul-25 05:09 UTC
[Samba] silent file truncation on ext3 with linux quota v0
On Mon, 21 Jul 2003, Johannes Niess wrote:> The following message is a courtesy copy of an article > that has been posted to comp.protocols.smb as well. > > Hi, > > I'm trying to implement file system quotas on a Debian Woody Linux > box. My problem is that W2k Explorer silently truncates files when > going over quota by copying files. Other applications work as > expected and show a "disk full" error message.Which applications are working OK?> > To me it looks like the error code for "over quota" is not propagated > back from samba to Windows Explorer. > > I've tried with all combinations of Linux kernel 2.4.18, latest > 2.4-ac, samba-2.2.3a-12 (from woody) and a debian source package > 2.2.8a reconfigured --with-quota. I've not yet used a newer quota > package. > > I've found some descriptions of the problem, but no workaround. I > understand that samba supports only v2 version quotas (from the -ac > kernel series and maybe latest 2.4-marcelo's-pre). I'm not asking for > support of network drives size set to quotas. A "dfree command" can > easily do that. > > BTW: What's the status of quota support in Samba 3? What I really want > are quotas per samba share, independend of the OS.Samba does not implement quotas. Quotas are an OS issue. There is no way for samba to implement quotas without massive overheads the performance hit will be too high. The only way in which samba interacts with OS quotas is in reporting remaining quota capacity. If you believe that the file trucation problem is an abnormal behaviour then you will need to capture a level 5 debug log and post a bug report with it at https://bugzilla.samba.org - John T.> > Thank you very much. > > Johannes Nie? > > -- > To unsubscribe from this list go to the following URL and read the > instructions: http://lists.samba.org/mailman/listinfo/samba >-- John H Terpstra Email: jht@samba.org