public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Haynes <thomas.haynes@primarydata.com>
To: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Linux NFS Mailing list <linux-nfs@vger.kernel.org>,
	Tom Haynes <loghyr@primarydata.com>
Subject: [PATCH] pnfs: Do not schedule layout segment work if there is no work to be done.
Date: Tue,  7 Oct 2014 10:59:47 -0700	[thread overview]
Message-ID: <1412704787-46388-1-git-send-email-Thomas.Haynes@primarydata.com> (raw)

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


             reply	other threads:[~2014-10-07 18:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-07 17:59 Thomas Haynes [this message]
2014-10-07 18:02 ` [PATCH] pnfs: Do not schedule layout segment work if there is no work to be done Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1412704787-46388-1-git-send-email-Thomas.Haynes@primarydata.com \
    --to=thomas.haynes@primarydata.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=loghyr@primarydata.com \
    --cc=trond.myklebust@primarydata.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox