Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp476898pxj; Thu, 3 Jun 2021 11:14:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZWPlbJO6J+HuQUQvPmmJ/O5xzNIjwEe71RyPHOVGwgXVWPjCmAvPJC9Pp58zCNbaN4ln8 X-Received: by 2002:a05:6402:254d:: with SMTP id l13mr730399edb.281.1622744064616; Thu, 03 Jun 2021 11:14:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622744064; cv=none; d=google.com; s=arc-20160816; b=B2epoOlHV8Z7aUspnX2QPx2YAAv2js0Cmmv5h9FHOyTfEfzICls85R3dUlg5ivEN57 +XuJB73fyMPW/ThW8owJoETCh6u7oqs773Z/byXLodG1D6WWAuim6lQolEW7yoBzMQh7 lFmc0bkvgRa5+NUpPdJ2afpUG/m4TCTeXQ3umRBR+F26+q5QPqmyabmoDnhKTXP0cSl3 ZiW8a3ta0yIPO1UDOEtnzHXyLh3LVpk5TI3Wr4ymMrNW1VoUeqn0AM3OzDjWum4Czs5V 05SZoM5BEZTY7lPPzBqHnHNjMbdGahb19RZMW0Q0ydQDJVsox6JhDahGzQOkC2pFLWTc FNAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1MM/KF2zb9kJTPLvn+kI9WBkJJJ1ZUI5/inenGZho9E=; b=X+QNifWpcAZdLHu4zaaGM8eRRs4+A2oLrlHMfs/aHyvZrFWc5yQ2sXneugsvpALN0U FHHhu+5Du/vAwpmPJ2E38jyMgnOvSbiRpquzAngMxltnOmSuntBkwHC2rV/UMguXVvL+ G2TRy+G0XnrGMPebFbCusFdpFFxam/meF4XCM5sJ1Y76pJHqQKVCNOGJ4cUKf25B0OVi qvfAkuHDJWEFt5LtZWuySLGwc5kC8Qxv33APleSxbJ8WaEAeFXw7ui0R20XTZwbYh1H8 FAEUvZXlFI3vzVb6z/DOuQ4EGSplrLbT1hcOskplVsXLlnUmrTlZYwLtLXyVPNSqJgaC uCJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=E+zwjwbZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pg13si2781190ejb.35.2021.06.03.11.14.00; Thu, 03 Jun 2021 11:14:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=E+zwjwbZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229769AbhFCSO0 (ORCPT + 99 others); Thu, 3 Jun 2021 14:14:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:47564 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbhFCSO0 (ORCPT ); Thu, 3 Jun 2021 14:14:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D8BCE61358; Thu, 3 Jun 2021 18:12:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622743960; bh=F/y2/Xdi0ro0EVjX6ng9wtgqyP3SEfu7omS9AaaCxz0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=E+zwjwbZ5433owWIuNAL0slq9gnMTykhFnj259Z7uuxekTrLWZ8d0/2oSKIaXjOtm wgnKEzggP+U3Ure3VSX81M+MGaA5bKQbUF72rvUVg1RSTQsUQ6VkhIwT0zKG2Eq2j4 zJv+K6EbCV/Cc50bFTABSoerC5xw3DRTaAG7bkj0= Date: Thu, 3 Jun 2021 20:12:37 +0200 From: Greg KH To: Jaegeuk Kim Cc: Daniel Rosenberg , Chao Yu , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Gabriel Krisman Bertazi , kernel-team@android.com, stable@vger.kernel.org Subject: Re: [PATCH v2 2/2] f2fs: Advertise encrypted casefolding in sysfs Message-ID: References: <20210603095038.314949-1-drosen@google.com> <20210603095038.314949-3-drosen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 03, 2021 at 10:53:26AM -0700, Jaegeuk Kim wrote: > On 06/03, Greg KH wrote: > > On Thu, Jun 03, 2021 at 08:40:24AM -0700, Jaegeuk Kim wrote: > > > On 06/03, Greg KH wrote: > > > > On Thu, Jun 03, 2021 at 09:50:38AM +0000, Daniel Rosenberg wrote: > > > > > Older kernels don't support encryption with casefolding. This adds > > > > > the sysfs entry encrypted_casefold to show support for those combined > > > > > features. Support for this feature was originally added by > > > > > commit 7ad08a58bf67 ("f2fs: Handle casefolding with Encryption") > > > > > > > > > > Fixes: 7ad08a58bf67 ("f2fs: Handle casefolding with Encryption") > > > > > Cc: stable@vger.kernel.org # v5.11+ > > > > > Signed-off-by: Daniel Rosenberg > > > > > --- > > > > > fs/f2fs/sysfs.c | 15 +++++++++++++-- > > > > > 1 file changed, 13 insertions(+), 2 deletions(-) > > > > > > > > > > diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c > > > > > index 09e3f258eb52..6604291a3cdf 100644 > > > > > --- a/fs/f2fs/sysfs.c > > > > > +++ b/fs/f2fs/sysfs.c > > > > > @@ -161,6 +161,9 @@ static ssize_t features_show(struct f2fs_attr *a, > > > > > if (f2fs_sb_has_compression(sbi)) > > > > > len += scnprintf(buf + len, PAGE_SIZE - len, "%s%s", > > > > > len ? ", " : "", "compression"); > > > > > + if (f2fs_sb_has_casefold(sbi) && f2fs_sb_has_encrypt(sbi)) > > > > > + len += scnprintf(buf + len, PAGE_SIZE - len, "%s%s", > > > > > + len ? ", " : "", "encrypted_casefold"); > > > > > len += scnprintf(buf + len, PAGE_SIZE - len, "%s%s", > > > > > len ? ", " : "", "pin_file"); > > > > > len += scnprintf(buf + len, PAGE_SIZE - len, "\n"); > > > > > > > > This is a HUGE abuse of sysfs and should not be encouraged and added to. > > > > > > This feature entry was originally added in 2017. Let me try to clean this up > > > after merging this. > > > > Thank you. > > > > > > Please make these "one value per file" and do not keep growing a single > > > > file that has to be parsed otherwise you will break userspace tools. > > > > > > > > And I don't see a Documentation/ABI/ entry for this either :( > > > > > > There is in Documentation/ABI/testing/sysfs-fs-f2fs. > > > > So this new item was documented in the file before the kernel change was > > made? > > Do we need to describe all the strings in this entry? > > 203 What: /sys/fs/f2fs//features > 204 Date: July 2017 > 205 Contact: "Jaegeuk Kim" > 206 Description: Shows all enabled features in current device. Of course! Especially as this is a total violation of normal sysfs files, how else are you going to parse the thing? Why wouldn't you describe the contents? But again, please obsolete this file and make the features all individual files like they should be so that you do not have any parsing problems. thanks, greg k-h