public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pnfs: Do not schedule layout segment work if there is no work to be done.
@ 2014-10-07 17:59 Thomas Haynes
  2014-10-07 18:02 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Haynes @ 2014-10-07 17:59 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: Linux NFS Mailing list, Tom Haynes

From: Tom Haynes <loghyr@primarydata.com>

Callers of pnfs_put_lseg_async() might encounter no writes to
be committed, etc. As such, do not attempt to add work if none
is needed. Also, don't oops if that is the case.

Signed-off-by: Tom Haynes <loghyr@primarydata.com>
---
 fs/nfs/pnfs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 76de7f5..08b1060 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -373,6 +373,9 @@ static void pnfs_put_lseg_async_work(struct work_struct *work)
 void
 pnfs_put_lseg_async(struct pnfs_layout_segment *lseg)
 {
+	if (!lseg)
+		return;
+
 	INIT_WORK(&lseg->pls_work, pnfs_put_lseg_async_work);
 	schedule_work(&lseg->pls_work);
 }
-- 
1.9.3


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

* Re: [PATCH] pnfs: Do not schedule layout segment work if there is no work to be done.
  2014-10-07 17:59 [PATCH] pnfs: Do not schedule layout segment work if there is no work to be done Thomas Haynes
@ 2014-10-07 18:02 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2014-10-07 18:02 UTC (permalink / raw)
  To: Thomas Haynes; +Cc: Trond Myklebust, Linux NFS Mailing list, Tom Haynes

On Tue, Oct 07, 2014 at 10:59:47AM -0700, Thomas Haynes wrote:
> From: Tom Haynes <loghyr@primarydata.com>
> 
> Callers of pnfs_put_lseg_async() might encounter no writes to
> be committed, etc. As such, do not attempt to add work if none
> is needed. Also, don't oops if that is the case.

I think that last issue is the main culprit, isn't it? :)

I still think adding the NULL check to filelayout_clear_request_commit
would be more reasonable, as it's clear that freeme can be NULL there,
but as pnfs_put_lseg accepts a NULL lseg it's probably wise to keep
the two in sync.

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

end of thread, other threads:[~2014-10-07 18:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-07 17:59 [PATCH] pnfs: Do not schedule layout segment work if there is no work to be done Thomas Haynes
2014-10-07 18:02 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox