[linux-cifs-client] Re: [PATCH 4/4] cifs: flush data on any setattr

Linus Torvalds torvalds at linux-foundation.org
Fri Mar 27 00:07:48 GMT 2009



On Thu, 26 Mar 2009, Jeff Layton wrote:
>
> I suspect that there is another bug for the reporter that's consistently
> causing a reconnect of the socket after the fchmod. That problem could
> even be server-side (hard to know without a wire capture and/or some
> debug logs).

Sure. There probably is. But even if we were to fix that unrelated issue, 
you might still have totally random events that cause re-connects for 
non-buggy reasons (say, a real network problem), so regardless it's not 
correct to assume that reconnects cannot happen.

> On the performance side, we can always go back and optimize the flush
> out of some of setattr calls when we *know* that they won't cause a
> problem, but the list of those cases is starting to look pretty small.

Agreed. Especially as you end up having to flush at the close() anyway, 
and anybody who does some attribute change after writing dirty data is 
likely to close the file afterwards anyway. IOW, I suspect

	open
	write+write+write
	fchmod/fchown
	close

is fairly normal, but _mixing_ things so that you see

	open
	write+write
	fchmod/fchown
	write+write
	close

is rather less likely. So flushing the data probably doesn't even add any 
overhead.

		Linus


More information about the linux-cifs-client mailing list