plan for a feature: fsync for assuring file size

James Peach jpeach at samba.org
Wed Oct 24 23:40:18 GMT 2007


On Oct 24, 2007, at 3:30 PM, SER.RI-TIC - David Losada wrote:

> En/na James Peach ha escrit:
>>> Thanks for showing me this, I didn't think about looking at VFS  
>>> modules.
>>>
>>> However, that would statistically reduce the probability of the  
>>> problem
>>> to arise,
>>
>> Which is the best you can do without being able to verify integrity
>> through the whole storage stack and having a big pile of nvram or
>> battery-backed cache.
>>
>>> but wouldn't be 100% effective. In the example.. what if
>>> someone tries to write a file that exceeds the quota in 1KB ? The  
>>> error
>>> would arise when the client closes the file, and Windows clients  
>>> would
>>> ignore it, then. The data would be lost and the user wouldn't know.
>>
>> I think this is a poor example. There's no space to write the
>> requested data so we return an error to the client. It's the client's
>> responsibility to propagate or handle that error. If we can't write
>> the data, I don't know where we would put it such that it wouldn't  
>> get
>> lost.
> I totally intend data to get lost due to exceeded quota ;). As long as
> the user gets a notice for it, that is. And I would prefer them to  
> get a
> notice every time it happens.

It's easy to write a VFS module that takes some kind of action when  
one of the write calls returns a space or quota error. I'm not sure  
how you would notify the user that something bad happened other than  
by returning the error.

> I know it's not Samba misbehaviour. If windows behaved correctly this
> would be a non issue... if there was a solution which wouldn't ask  
> me to
> patch all windows machines (some of them not under our control), or
> ditch the investment we have made, or significantly slow our Samba
> servers.. I would go for it. Yes, this thing I'm proposing is a  
> workaround.
>
> I think I understand that maybe because of this you'd rather have it  
> in
> a module, not in core code.

I don't think I understand exactly what you want to do :)

--
James Peach | jpeach at samba.org



More information about the samba-technical mailing list