Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2992474AbbEVJMw (ORCPT ); Fri, 22 May 2015 05:12:52 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:55189 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964806AbbEVJMt (ORCPT ); Fri, 22 May 2015 05:12:49 -0400 X-AuditID: cbfec7f5-f794b6d000001495-6b-555ef30eb945 Message-id: <555EF30C.60108@samsung.com> Date: Fri, 22 May 2015 11:12:44 +0200 From: Marcin Jabrzyk Organization: Samsung R&D Institute Poland User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-version: 1.0 To: Sergey Senozhatsky Cc: minchan@kernel.org, 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 References: <1432283515-2005-1-git-send-email-m.jabrzyk@samsung.com> <20150522085523.GA709@swordfish> In-reply-to: <20150522085523.GA709@swordfish> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCLMWRmVeSWpSXmKPExsVy+t/xq7p8n+NCDW7tULY42/SG3eLyrjls FvfW/Ge1WPb1PbvFhpZZ7BaPJkxicmDz2DnrLrvHplWdbB6bPk1i9+jbsorRY+enzawenzfJ BbBFcdmkpOZklqUW6dslcGUsvXOFuWA2Z8WpjScZGxgXsncxcnJICJhI/F77nhHCFpO4cG89 WxcjF4eQwFJGiUuL1rKAJIQEnjFKvN0mB2LzCmhINN58A9bAIqAqseHFAiCbg4NNQEfi/GoN kDC/gJbEmqbrLCBhUYEIie4TlRCdghI/Jt8DmygiYCVxZ9U1MJtZoELi6barrCC2sICTxK/b TUwgrUIC6RKPjpuChDkFdCV+PLrPClFuK7Hg/TqoVnmJzWveMk9gFJyFZMMsJGWzkJQtYGRe xSiaWppcUJyUnmukV5yYW1yal66XnJ+7iRES9l93MC49ZnWIUYCDUYmH1+BgXKgQa2JZcWXu IUYJDmYlEV6Zm0Ah3pTEyqrUovz4otKc1OJDjNIcLErivDN3vQ8BOjqxJDU7NbUgtQgmy8TB KdXAaFPes+OBOmfz0YnHtCvCc6VFrAQ2F74wS2Z7Iznz59+TfsKrzz9YtI1VS7vUnkH5lR5v evEbm+qbd11+pDz1T50ReeqylMVfpjzmp8xyVvmuM3jF+jRvmzQ5ewhs3JEhtPqAwJ8TNn3Z yXl95eaJ8nMCXi9zm73MKn9Sea+dyY6Hi+QZPf4psRRnJBpqMRcVJwIAgFFOKXcCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1383 Lines: 46 Hi, On 22/05/15 10:56, Sergey Senozhatsky wrote: > On (05/22/15 10:31), Marcin Jabrzyk wrote: >> Zram sysfs interface was not making any check of >> proper compressor name when setting it. >> Any name is accepted, but further tries of device >> creation would end up with not very meaningfull error. >> eg. >> >> echo lz0 > comp_algorithm >> echo 200M > disksize >> echo: write error: Invalid argument >> > > no. > > zram already complains about failed comp backend creation. > it's in dmesg (or syslog, etc.): > > "zram: Cannot initialise %s compressing backend" > OK, now I see that. Sorry for the noise. > second, there is not much value in exposing zcomp internals, > especially when the result is just another line in dmesg output. From the other hand, the only valid values that can be written are in 'comp_algorithm'. So when writing other one, returning -EINVAL seems to be reasonable. The user would get immediately information that he can't do that, now the information can be very deferred in time. I'm not for exposing more internals, but getting -EINVAL would be nice I think. > > -ss > Best regards, Marcin Jabrzyk -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/