tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

NFS client fix - was NFS over-quota not detected if utimes() called before fsync()/close()



On Aug 1, 2013, at 10:31 AM, J. Hannken-Illjes 
<hannken%eis.cs.tu-bs.de@localhost> wrote:

> On Jul 31, 2013, at 10:04 PM, Christos Zoulas <christos%astron.com@localhost> 
> wrote:
> 
>> In article <20130730211200.GD96484%trav.math.uni-bonn.de@localhost>,
>> Edgar Fuß  <ef%math.uni-bonn.de@localhost> wrote:
>>>> I think the problem is in nfs_setattr(), sys/nfs/nfs_vnops.c:681,
>>>> where files are flushed before setattr "because a later write of
>>>> cached data might change timestamps or reset sugid bits", but the
>>>> only return value of nfs_vinvalbuf() that's treated as an error is
>>>> EINTR. Why?
>>> Any comments on this?
>>> We are losing mail because of this problem so I would like to get it fixed.
>> 
>> Yes, I believe you are right. Return an error for all errors.
> 
> No - nfs_vinvalbuf() returns zero or EINTR, there are no other errors.
> 
> Does vinvalbuf() return an error from fsync here thats gets missed
> because vinvalbuf() loops until it returns zero?

To answer my own question: Yes, nfs_vinvalbuf() ignores errors from
vinvalbuf() and therefore delayed write errors get lost.  Running the
test on NFS v2 instead of NFS v3, these errors even get lost with
fsync() or close() only.

The attached diff fixes this behaviour by keeping delayed write errors
from vinvalbuf() for fsync() or close().

Comments or objections anyone?

--
J. Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig 
(Germany)

Attachment: nfs_bio.diff
Description: Binary data



Home | Main Index | Thread Index | Old Index