From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Marcin Jabrzyk <m.jabrzyk@samsung.com>,
Nitin Gupta <ngupta@vflare.org>,
linux-kernel@vger.kernel.org,
Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Subject: Re: [PATCH] zram: check comp algorithm availability earlier
Date: Wed, 27 May 2015 14:53:20 +0900 [thread overview]
Message-ID: <20150527055320.GA3928@swordfish> (raw)
In-Reply-To: <20150527035142.GA11609@blaptop>
On (05/27/15 12:51), Minchan Kim wrote:
[..]
> > @@ -378,6 +378,12 @@ static ssize_t comp_algorithm_store(struct device *dev,
> > if (sz > 0 && zram->compressor[sz - 1] == '\n')
> > zram->compressor[sz - 1] = 0x00;
> >
> > + if (!zcomp_available_algorithm(zram->compressor)) {
> > + pr_err("Error: unavailable compression algorithm: %s\n",
> > + zram->compressor);
> > + len = -EINVAL;
> > + }
> > +
>
> I'm not against this patch because it's better than old.
> But let's think more about the pr_err part.
>
> If user try to set wrong algo name, he can see EINVAL.
> Isn't it enough?
>
> I think every sane admin can think he passed wrong argument
> if he sees -EINVAL.
> So, I don't think we need to emit pr_err in here.
>
well, it's here simply to make failure investigation easier.
one surely will know that supplied string was not recognized
as a compression algorithm name, but what was it.. "$3 instead
of $2... or, wait, did $i contain something wrong?". zram knew
what was wrong.
/* and you asked to put this warn here in your previous email. */
sure, can remove it.
> The reason I am paranoid about that is that I really don't want
> to argue with syslog info which is part of ABI or not in future.
> If possible, I don't want to depend on pr_xxx.
>
just for the record... I don't understand this part.
ok. I'll resend later today.
-ss
next prev parent reply other threads:[~2015-05-27 5:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-26 13:13 [PATCH] zram: check comp algorithm availability earlier Sergey Senozhatsky
2015-05-27 3:51 ` Minchan Kim
2015-05-27 5:53 ` Sergey Senozhatsky [this message]
2015-05-27 5:58 ` Minchan Kim
2015-05-27 6:12 ` Sergey Senozhatsky
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=20150527055320.GA3928@swordfish \
--to=sergey.senozhatsky.work@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.jabrzyk@samsung.com \
--cc=minchan@kernel.org \
--cc=ngupta@vflare.org \
--cc=sergey.senozhatsky@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