From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
Marcin Jabrzyk <m.jabrzyk@samsung.com>,
ngupta@vflare.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, kyungmin.park@samsung.com
Subject: Re: [PATCH] zram: check compressor name before setting it
Date: Tue, 26 May 2015 09:09:27 +0900 [thread overview]
Message-ID: <20150526000927.GA566@swordfish> (raw)
In-Reply-To: <20150525142149.GD14922@blaptop>
Hi,
On (05/25/15 23:21), Minchan Kim wrote:
[..]
> find_backend is just utility function to get zcomp_backend.
> IOW, it might be used for several cases in future so I want
> make error report as caller's work.
[..]
> > if (sz > 0 && zram->compressor[sz - 1] == '\n')
> > zram->compressor[sz - 1] = 0x00;
> >
> > + if (!zcomp_known_algorithm(zram->compressor))
>
> In here, we could report back to the user.
the motivation was that we actually change user land interface
here and it's quite possible that none of the existing scripts
handle errors returned from `echo X > /../comp_algorithm`, simply
because it has never issued any errors; not counting -BUSY, which
may be not relevant for the vast majority of the scripts:
#!/bin/sh
modprobe zram
echo $1 > /sys/block/zram0/max_comp_streams
echo $2 > /sys/block/zram0/comp_algorithm
[..]
echo $3 > /sys/block/zram0/disksize
if [ $? ... ]
...
fi
mkfs.xxx /dev/zram0
mount -o xxx /dev/zram0 /xxx
`echo $2 > /sys/block/zram0/comp_algorithm` -EINVAL return can be
ignored (and, thus, syslog message as well); because `comp_algorithm`
has never returned anything for that trivial script. so that's why I
wanted to print extra `unknown compression algorithm` message during
disksize store.
-ss
> > + len = -EINVAL;
> > +
> > up_write(&zram->init_lock);
> > return len;
> > }
> >
> > --
> > To unsubscribe, send a message with 'unsubscribe linux-mm' in
> > the body to majordomo@kvack.org. For more info on Linux MM,
> > see: http://www.linux-mm.org/ .
> > Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>
> --
> Kind regards,
> Minchan Kim
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2015-05-26 0:09 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-22 8:31 Marcin Jabrzyk
2015-05-22 8:56 ` Sergey Senozhatsky
2015-05-22 9:12 ` Marcin Jabrzyk
2015-05-22 12:44 ` Sergey Senozhatsky
2015-05-22 13:14 ` Minchan Kim
2015-05-22 13:34 ` Marcin Jabrzyk
2015-05-25 4:03 ` Sergey Senozhatsky
2015-05-25 14:16 ` Minchan Kim
2015-05-22 13:26 ` Marcin Jabrzyk
2015-05-25 6:18 ` Sergey Senozhatsky
2015-05-25 6:23 ` Sergey Senozhatsky
2015-05-25 7:15 ` Marcin Jabrzyk
2015-05-25 7:34 ` Sergey Senozhatsky
2015-05-25 8:05 ` Marcin Jabrzyk
2015-05-25 14:21 ` Minchan Kim
2015-05-26 0:09 ` Sergey Senozhatsky [this message]
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=20150526000927.GA566@swordfish \
--to=sergey.senozhatsky.work@gmail.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=m.jabrzyk@samsung.com \
--cc=minchan@kernel.org \
--cc=ngupta@vflare.org \
/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