public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: Manish Katiyar <mkatiyar@gmail.com>
Cc: ext4 <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] logsave : Avoid unnecessary backgrounding of logsave in case of failures
Date: Fri, 10 Oct 2008 14:31:57 -0400	[thread overview]
Message-ID: <20081010183157.GD8645@mit.edu> (raw)
In-Reply-To: <ea11fea30810071044l6d8887e0udb52342f82412e4a@mail.gmail.com>

On Tue, Oct 07, 2008 at 11:14:11PM +0530, Manish Katiyar wrote:
> Hi Ted,
> 
> I am not sure why we wan't to background the logsave and keep retrying
> opening the fd in case of failures. 

That's one of the main reason why logsave exists; the filesystem
containing /var/log might not be mounted, or the root filesystem may
be mounted read-only, and so the log file can't be written until the
filesystem is remounted r/w or /var is mounted.

> But there may be situations when we will never be able to succeed
> and thus create unnecessary process. For example invoking it
> 
> /home/mkatiyar/sbin> ./logsave /testfile ls

The main use of logsave was in init.d scripts.  So I didn't really
worry about the permissoin denied case.  Perhaps logsave should just
fail hard and not even run the command if there is a permission denied
error.  That would certainly be simpler...

> +static void should_background(int err, int *nobackground) {
> +	switch (err) {
> +		case EPERM:
> +		case EACCES:
> +			*nobackground = err;
> +			break;
> +		default :
> +			*nobackground = 0;
> +	}
> +	return ;
> +}

Why is this its own function?

						- Ted

  reply	other threads:[~2008-10-10 18:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-07 17:44 [PATCH] logsave : Avoid unnecessary backgrounding of logsave in case of failures Manish Katiyar
2008-10-10 18:31 ` Theodore Tso [this message]
2008-10-10 18:48   ` Manish Katiyar

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=20081010183157.GD8645@mit.edu \
    --to=tytso@mit.edu \
    --cc=linux-ext4@vger.kernel.org \
    --cc=mkatiyar@gmail.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