linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* spurious sillyrename after O_DIRECT writes get ENOSPC
@ 2017-12-08 22:16 J. Bruce Fields
  2017-12-13 17:18 ` J. Bruce Fields
  0 siblings, 1 reply; 7+ messages in thread
From: J. Bruce Fields @ 2017-12-08 22:16 UTC (permalink / raw)
  To: linux-nfs; +Cc: hch

Last year Christoph noticed a bug that could result in a file being
unnecessarily sillyrenamed after O_DIRECT writes get ENOSPC:

	http://lkml.kernel.org/r/20160616150146.GA14015@infradead.org

It's reproduceable on upstream, over v3 or v4.

I looked into it some more, and it seems to reproduce whenever a write
system call results in multiple WRITE calls, only some of which receive
ENOSPC.  I think that's resulting in a leak of the wb_kref on some
nfs_pages (possibly the ones corresponding to the ENOSPC failures?).
Those nfs_pages in turn hold references on nfs_{lock,open}_contexts.  So
a "rm" on the client (even after the file is closed) results in a
sillyrename.

I'll keep looking at this, but the relevant code is pretty opaque to me
so far.  Any ideas welcomed.

--b.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-01-16 15:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-08 22:16 spurious sillyrename after O_DIRECT writes get ENOSPC J. Bruce Fields
2017-12-13 17:18 ` J. Bruce Fields
2017-12-14 13:08   ` Benjamin Coddington
2017-12-14 16:36     ` J. Bruce Fields
2017-12-14 18:55       ` J. Bruce Fields
2017-12-19 16:56         ` J. Bruce Fields
2018-01-16 15:08           ` [PATCH] NFS: commit direct writes even if they fail partially J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).