linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Seiji Aguchi <seiji.aguchi@hds.com>
To: Seiji Aguchi <seiji.aguchi@hds.com>,
	Mike Waychison <mikew@google.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Luck, Tony (tony.luck@intel.com)" <tony.luck@intel.com>,
	"Matthew Garrett (mjg@redhat.com)" <mjg@redhat.com>,
	"dzickus@redhat.com" <dzickus@redhat.com>,
	"linux-efi@vger.kernel.org" <linux-efi@vger.kernel.org>
Cc: "dle-develop@lists.sourceforge.net" 
	<dle-develop@lists.sourceforge.net>,
	Satoru Moriya <satoru.moriya@hds.com>
Subject: [RESEND][PATCH v4 3/3] efi_pstore: Skiping scheduling a workqueue in cases other than oops
Date: Tue, 4 Sep 2012 22:08:18 +0000	[thread overview]
Message-ID: <A5ED84D3BB3A384992CBB9C77DEDA4D413826EEF@USINDEM103.corp.hds.com> (raw)

[Problem]
 efi_pstore creates sysfs files when logging kernel messages to NVRAM.
 Currently, the sysfs files are updated in a workqueue which is registered in a write callback.

 On the other hand, situations which users need the sysfs files are when they erase entries or oops happen 
 because a system will  be down and users can't access to sysfs files in other cases like panic, reboot or emergency_restart.

 Also, if kernel panics due to a bug of workqueue operations and a write callback of efi_pstore is called in
 panic case, efi_pstore may fail due to a failure of schedule_work(). 
 And panic_notifier_chain()/emergency_restart() is not kicked if efi_pstore fails.  
   This may cause user's unwanted result.

[Patch Description]
 This patch registers a workqueue updating sysfs entries in cases where users erase entries or oops happen only,
 and skips it in other cases like panic, reboot or emergency_start.

Signed-off-by: Seiji Aguchi <seiji.aguchi@hds.com>

---
 drivers/firmware/efivars.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index cd16ea6..d5911fd 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -746,7 +746,12 @@ static int efi_pstore_write(enum pstore_type_id type,
 
 	spin_unlock_irqrestore(&efivars->lock, flags);
 
-	schedule_work(&efivar_work);
+	/*
+	 * The user may want to update sysfs for this write
+	 * when they erase an entry via /dev/pstore or oops happen.
+	 */
+	if (!size || reason == KMSG_DUMP_OOPS)
+		schedule_work(&efivar_work);
 
 	*id = part;
 	return ret;
-- 
1.7.1

                 reply	other threads:[~2012-09-04 22:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=A5ED84D3BB3A384992CBB9C77DEDA4D413826EEF@USINDEM103.corp.hds.com \
    --to=seiji.aguchi@hds.com \
    --cc=dle-develop@lists.sourceforge.net \
    --cc=dzickus@redhat.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikew@google.com \
    --cc=mjg@redhat.com \
    --cc=satoru.moriya@hds.com \
    --cc=tony.luck@intel.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;
as well as URLs for NNTP newsgroup(s).