From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754976AbbIHNpK (ORCPT ); Tue, 8 Sep 2015 09:45:10 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:36595 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753551AbbIHNpH (ORCPT ); Tue, 8 Sep 2015 09:45:07 -0400 Date: Tue, 8 Sep 2015 22:44:01 +0900 From: Sergey Senozhatsky To: Minchan Kim Cc: Sergey Senozhatsky , Luis Henriques , linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [PATCH] zram: don't copy invalid compression algorithms Message-ID: <20150908134401.GA590@swordfish> References: <1441658910-10226-1-git-send-email-luis.henriques@canonical.com> <20150907235635.GA6896@swordfish> <20150908011443.GB19776@bbox> <20150908013338.GF6896@swordfish> <20150908015831.GG6896@swordfish> <20150908045017.GA30100@bbox> <20150908050442.GA609@swordfish> <20150908081610.GA8633@bbox> <20150908095428.GA14220@swordfish> <20150908133303.GA2174@bbox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150908133303.GA2174@bbox> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org dammit, not going to waste my time on this BS anymore. > > --- a/drivers/block/zram/zram_drv.c > > +++ b/drivers/block/zram/zram_drv.c > > @@ -365,6 +365,9 @@ static ssize_t comp_algorithm_store(struct device *dev, > > struct zram *zram = dev_to_zram(dev); > > size_t sz; > > > > + if (!zcomp_available_algorithm(buf)) > > + return -EINVAL; > > If you ignore tailling space, your change would make a bug. > If you fix it, it looks good to me. that's why find_backend() calls sysfs_streq(), which takes care of a trailing new line. unless you're speaking about something else. -ss