Samba 2.2 Top of Tree - strict allocate behavior?

P Ranjit Kumar ranjit at cup.hp.com
Thu Jan 24 13:15:28 GMT 2002


Hi

I just looked at the disk quotas and strict allocate behavior in samba 2.2
top of tree source. I don't understand the logic. Here is what I think.

Looks like in reply_write() (smbd/reply.c) calls vfs_allocate_file_space(),
that actually doesn't allocate space, but merely checks if there is enough
space.

vfs_set_filelen() is called after vfs_allocate_file_space(). This is the one
that allocates space for the file.

vfs_allocate_file_space checks whether "strict allocate" is set or not
before it checks for free space. I think this check is misplaced because
vfs_allocate_file_space doesn't allocate space. Which means, whether or not
"strict allocate" is set you are going to allocate space by calling
vfs_set_filelen().

I think the check for "strict allocate" should be made in reply.c before
calling vfs_set_file_len() or in vfs_set_filelen().

Changing it the way I suggested ensures that the "strict allocate"
implementation is compliant with its definition. Also, the suggestion
ensures that NT 4.0 clients see disk full error without the server
allocating space in most cases.

Any comments?

- Ranjit
CIFS Team @ HP





More information about the samba-technical mailing list