Bug 203898 - Files written on XP to a NFS mounted partition with quotas shared with Samba are silently truncated
Files written on XP to a NFS mounted partition with quotas shared with Samba ...
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: samba (Show other bugs)
i686 Linux
medium Severity high
: ---
: ---
Assigned To: Guenther Deschner
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2006-08-24 07:14 EDT by Stefan Walter
Modified: 2010-05-10 10:38 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-05-10 10:38:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Stefan Walter 2006-08-24 07:14:52 EDT
Description of problem:

In our setup an NFS server exports directories with user quotas. A second
Samba server mounts the directories and shares them. When writing to
such a share on Windows XP when the hard limit of the quota is reached,
the files are truncated or filled with garbage without any error message. 

Version-Release number of selected component (if applicable):

Linux fire 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:27:17 EDT 2006 i686 i686 i386


How reproducible:

NFS export a partition with user quotas on one server, mount it on another
server and share the mounted NFS share to a Windows XP client. Set a quota for a
user and map a network drive to the share as the user with the quota.
Attempt to copy more data to the share than the user quota's hard block limit.

Steps to Reproduce:
1. On the NFS server (here fire) prepare a partition /local with user quotas
turned on and do:
fire:~# mount | grep local
/dev/sda8 on /local type ext3 (rw,usrquota)
fire:~# df /local
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda8            136163944    119700 129127460   1% /local
fire:~# quota walteste
Disk quotas for user walteste (uid 50515): none
fire:~# setquota -u walteste 10000 20000 1000 2000 /local
fire:~# quota walteste
Disk quotas for user walteste (uid 50515):
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
      /dev/sda8    8764   10000   20000             104    1000    2000         
fire:~# exportfs -o async,rw ice:/local

2. On the Samba server (here ice) use the factory smb.conf supplied with RHEL
AS4 and do:
ice:/# mkdir /remote
ice:~# mount fire:/local /remote
ice:~# df /remote
Filesystem           1K-blocks      Used Available Use% Mounted on
fire:/local          136163968    119712 129127488   1% /remote
ice:/etc/samba# cat >>smb.conf
  path = /remote
  browseable = no
  writable = yes
  comment = Remote with quota

ice:/remote# service smb restart
Shutting down SMB services:                                [  OK  ]
Shutting down NMB services:                                [  OK  ]
Starting SMB services:                                     [  OK  ]
Starting NMB services:                                     [  OK  ]

3. Map a netwoork drive to '\\ice\remote' on a fully updated Windows XP
Professional client and try to copy 50MB data to the share
Actual results:

The files are all copied and the correct sizes are displayed in the
file properties dialog in windows. The files written after the users
hard block limit was reached on the NFS server contain garbage.

Expected results:

An error message should be displayed when the quota is reached. Ideally this
message should indicate that the problem is related to the quota. A simple 
I/O error od disk full message would also help.

Additional info:

Using 'strict allocate = YES' in the smb.conf will truncate files to the size
that could effectively been written to the NFS server but does not display an
error messager either. Enabling strict allocation is the documented way to get
the error messages to display. This does not seem to be effective for the Samba
shipping with RHEL.
Comment 1 Dmitri Pal 2010-05-10 10:38:42 EDT
Resharing of NFS, especially for writing, is not supported.

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