From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E27D376A0A for ; Fri, 24 Jul 2026 05:28:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784870887; cv=none; b=Xom+vZ3uiG4/TR1ng+iaB5hXyCcoxVtRe0h1bbsgMRk+sEVGGwzX++bWQKU+59XI4MtWuAarAV+eJSYxr9bfSdgi4gSjiYXGaU4L6VAnVn8af9iycTjzOqtiAZAhpA1/RmdZSVHrEg+piakBDxe50ItGtjANMRxbHUlfzW2/93c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784870887; c=relaxed/simple; bh=e3eFk56qC1aswalWanSluJKLapPRIS3jOtxP1UjlQ+c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=b65jTnpxnHkgfWgwnOFrJeaxEk1wPJ9d13nbknliJ4qCfibN0KDg3EtbzVnlQBe/QmrD92RPK/chV9WK8HfutmCyjVasXqqi9VEqqIj6Jth2z4UE3mWOxsE6/Pzk0BO4aMKuGrUDILlHrNqA55mVvirN914Qm3QpaWa97idy7Pw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=d5Oo5KkR; arc=none smtp.client-ip=209.85.210.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="d5Oo5KkR" Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-84e27035206so9081b3a.3 for ; Thu, 23 Jul 2026 22:28:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1784870882; x=1785475682; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=BqdCN7np/OnzZei+qTFQX7Mqn8owBvoqzCC1D2N5rP8=; b=d5Oo5KkR/der0ajZm+dThvCO5vNIdqxNN2h3tHyYKApcBms5ERdO5+4JvnkLnPi229 NUphLVqEyOu645ZjHZUpORkPN/C890ZfJ/mNd7pi2XDQ1JcP5YBIa7WX35phZMTxJZC5 N9P9shchd2U5PQK0hJibFusIzn2llxBilvDGw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784870882; x=1785475682; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=BqdCN7np/OnzZei+qTFQX7Mqn8owBvoqzCC1D2N5rP8=; b=laUufC4rQzZmlf9qoGJPodTyXZbyw0r84QqrUFb7c73eLXUhFr6/qylY2hdyeCk8rK nwDFkP07W6Q4aTQHr+L+dw1+h4qMAW229qgZEL1oW2r0XE3Y4+6oYHX6FftjxhScmZ64 lDiPK9G4D0o/pwniq9eXUjcAv4K6eUKAyvrh+o9RnnL431nu9c+rbrrYywS5NdumrpS0 hOIsnHYvGA/85XsczSzMpuIJeMwxOSs09sJuFhX8LLGBlJ4i6IVr5QNRhsUFyNCtJBiC 2G7KbmeElp9PU/pvBYfktkaelmxQWUGt5fwApsrXwxxJ9ju8gJu0AQCm9DDcMdf76tRv +OVw== X-Forwarded-Encrypted: i=1; AHgh+RpJKGIHKVNcpZobKui+JFavKmCPq/E87halAQw7Y/CiXS23ICOYStRNLDE8xppDzcB85yE3Fhgb+RbXjzA=@vger.kernel.org X-Gm-Message-State: AOJu0Yy7fjeoNi6Ydx2dpnmc4V3B7hpkBzvJ8D8h+nH7KjewKgn7q3oU 3cJLSsCff8RssJWln087z4cG7DBh0CQRfF0nZ8/MDogoiTNWMCQeaP47EO0BZBx1Yg== X-Gm-Gg: AR+sD13Lq8tLJs9r74R30uhTHbbpucxYVKd3NJ0xu2dNen2FhhyMn8FXWhUMzWQLlIG ZH/bHwEZMoyDZp4hUKSJoojjLW4RfpUlgtxw7S/ZYZ2FmvE7VaHPwaI9q+zvA/yu8/foLZX4h4X q+3rgyN6TnpDsBmVJg4lqUzLg6q/S+z7aDRyII1UQ5LcCgg3zrRYH1/6dPp5UTz39PzwWH1vlTC GV9B9URIXwI6GebSihmc6OvUCZpfV3pHjej2zK7yXJ7G6MERhIgMIJNPN8O33VFWVlvna9Z0fVl 2n8Q4KYfCu1YKWWqJdza809nVGvEpZjoBHm/1vHFf/r5FDckysT1xiWoTqu33tfXagSIZzf6D/n Qb2yvaw9QFJEvMMjDkg8KrEdrIqmcaIn+WWmAhNeEPAgSImOjUc+Mn5ADq5djAyAe9dxlGt7ItK it7FIQawVScUjKIqJsguuihSG65UoM1CoHNqj4fEN2vg== X-Received: by 2002:a05:6a00:1bcc:b0:848:2f84:72c with SMTP id d2e1a72fcca58-84e2c23fd19mr6027905b3a.63.1784870881717; Thu, 23 Jul 2026 22:28:01 -0700 (PDT) Received: from google.com ([2a00:79e0:2031:6:c102:f12d:5168:6be5]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84e1757488csm4011470b3a.33.2026.07.23.22.27.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2026 22:28:01 -0700 (PDT) Date: Fri, 24 Jul 2026 14:27:57 +0900 From: Sergey Senozhatsky To: Haoqin Huang Cc: minchan@kernel.org, senozhatsky@chromium.org, axboe@kernel.dk, terrelln@fb.com, dsterba@suse.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, rongwei.wrw@gmail.com, Haoqin Huang , Rongwei Wang Subject: Re: [PATCH 2/3] zram: add per-backend capability flags and validate parameters early Message-ID: References: <20260627070216.13511-1-haoqinhuang7@gmail.com> <20260627070216.13511-2-haoqinhuang7@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260627070216.13511-2-haoqinhuang7@gmail.com> On (26/06/27 15:02), Haoqin Huang wrote: > Writing dict or level parameters for algorithms that don't support > them was silently accepted but had no effect. Out-of-range levels > were silently clamped by the underlying library. Dict read failures > always lost the real error from kernel_read_file_from_path(). > > Add caps, level_min and level_max to zcomp_ops and validate > user-supplied parameters in algorithm_params_store() before storing, > giving immediate error feedback. Also fix comp_params_store() to > read the new dict into a temporary buffer before resetting old > parameters, making the update atomic. I probably would prefer not to add this. Again, zram setup is almost always automated, you figure out what you need to put into your init script once and you never touch it again. The 0 i_size for CD-dict is something that simply should not happen. If you insist on handling that then we can replace "sz < 0" with "sz <= 0", but that 0 len dictionary case is something purely theoretical.