Trond Myklebust wrote: > On Thu, 2007-07-12 at 10:12 +1000, Neil Brown wrote: >> When a write to a local filesystem hits a space limitation such as >> filesystem-full or quota-exhausted, the write fails synchronously. >> You get ENOSPC or EDQUOT immediately. >> >> NFS cannot do that efficiently. >> >> Currently, you don't get these errors until 'fsync' or 'close'. That >> is very different from local filesystem behaviour, and is less than >> ideal. >> >> The following patch causes these two errors to be returned through the >> next write call once they are known about. >> >> A possible extension would be to set a flag when we first get such an >> error, clear it when a write succeeds, and while the flag is set, do >> all writes synchronously. This would be even closer to >> local-filesystem semantics, but I'm not sure it is worth it. > > Well... I've been thinking along these last lines myself (i.e. forcing > all subsequent writes to be synchronous whenever an error occurs). OK, but... After it is triggered by a write error, how would the synchronous behavior be turned off? Both EDQUOT and ENOSPC, for example, are really a temporary error; if applications are smart enough, they can retry an EDQUOT and might get a successful write. In that case, performance would be hosed until.... the client decides it's OK to use unstable writes again.