Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp811267ybx; Fri, 1 Nov 2019 11:36:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5UD+UkGYwpzEOmCpVqPL8IdYHL5Bh1dgeFRppyXmnPt6McOFt88prUrdhqTe0NP9sK7Mw X-Received: by 2002:a17:906:e57:: with SMTP id q23mr11177818eji.303.1572633363707; Fri, 01 Nov 2019 11:36:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572633363; cv=none; d=google.com; s=arc-20160816; b=VJE/GXVs9iFPXvjIJMk0negAeAtgxPRDAvkrvisXIxAki+sW+vDp6r7WrzXwfSCEFE SEVENoXvMScUSrq5e8gvKVirS3ORlUilFAdiCxFKac0xPLC7Zte+U5bK0A05OEFxz3ia MJUmbzln6Z7xyTRj7jA8R+0F5lAxHbFwUWJGShoAh6JHGcrfGAbf62MU8rJ+G8kIxGaZ YZy3NKFjt3FgoVSi0TNFoo6T4JH9fBTWOg/CtlwY1ECwU6Q373aqnnB/5d6cSP+HQO4x QyxKHdZpOnutdUkVgbX8Ipt5MFU16ZbanAE3y7c8DyqcmyDDE2+M/zsCiNNBCmpT9r00 CwfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=loVcj32FllpAfgqTExDSAfQy1teYUT8w/yjMRqGqNPY=; b=iyOV4GYaqHCpkp1XYl0qi1cWzJEo2HXV1iTBySYW44IerM3oDzHG6F/Z5nqioH8pD/ jCT0beizV/gpjFRFjJDrRF8l2QKrbBBrCfz1D7vCD8qwyQ0VsrLHJoTp0QWdJWpfg51A kZLR7JxnoiwDB9wHK/C1AMncKNmBoDxO+C7fUUGcI7EfC0+PqHQNnDSnbgfQFzTR/ojd 3C8H7OY37VyWS4Q3jwlnjUs1pt3DmgK32nh0HOOTSSe9xp/czZG3MYpwLqd4T5/QGvZi qNRxXHemXf+zDJiLhDO6Sdg0vPUrxy+mluu1AdLjiT+AhdijIFqsnkBq/BvnaVD+wq9i lzWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hzidrk+U; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u20si3575905ejt.216.2019.11.01.11.35.35; Fri, 01 Nov 2019 11:36:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hzidrk+U; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727434AbfKASd0 (ORCPT + 99 others); Fri, 1 Nov 2019 14:33:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:60596 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726671AbfKASd0 (ORCPT ); Fri, 1 Nov 2019 14:33:26 -0400 Received: from localhost (unknown [104.132.0.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 520EB21734; Fri, 1 Nov 2019 18:33:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572633205; bh=O2xOXMU8ZuGa8qvDhmT8yNNHuqfhzhj+CDrM/y+R8mw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hzidrk+UjF6KOAXbE6VsYklvSG6v4p6oZqYY3BHWUMifu38B/OUELpDbD+afGyp6+ 9vqZyc1hVRscVcUMFAu1Hp1/YTh9T8Bcp4XzfLAVsAi5f3V/3eF/EJzoXBfImYp//E c8EBJE/0RMsGQPUUvMoTpfJRFaLjO5W/YJe+ukw4= Date: Fri, 1 Nov 2019 11:33:24 -0700 From: Jaegeuk Kim To: Eric Biggers Cc: linux-fscrypt@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, Satya Tangirala , Paul Crowley , Paul Lawrence , "Theodore Y . Ts'o" Subject: Re: [PATCH v2 3/3] f2fs: add support for IV_INO_LBLK_64 encryption policies Message-ID: <20191101183324.GA14664@jaegeuk-macbookpro.roam.corp.google.com> References: <20191024215438.138489-1-ebiggers@kernel.org> <20191024215438.138489-4-ebiggers@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191024215438.138489-4-ebiggers@kernel.org> User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 10/24, Eric Biggers wrote: > From: Eric Biggers > > f2fs inode numbers are stable across filesystem resizing, and f2fs inode > and file logical block numbers are always 32-bit. So f2fs can always > support IV_INO_LBLK_64 encryption policies. Wire up the needed > fscrypt_operations to declare support. > > Signed-off-by: Eric Biggers Acked-by: Jaegeuk Kim > --- > fs/f2fs/super.c | 26 ++++++++++++++++++++------ > 1 file changed, 20 insertions(+), 6 deletions(-) > > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > index 1443cee158633..851ac95229263 100644 > --- a/fs/f2fs/super.c > +++ b/fs/f2fs/super.c > @@ -2308,13 +2308,27 @@ static bool f2fs_dummy_context(struct inode *inode) > return DUMMY_ENCRYPTION_ENABLED(F2FS_I_SB(inode)); > } > > +static bool f2fs_has_stable_inodes(struct super_block *sb) > +{ > + return true; > +} > + > +static void f2fs_get_ino_and_lblk_bits(struct super_block *sb, > + int *ino_bits_ret, int *lblk_bits_ret) > +{ > + *ino_bits_ret = 8 * sizeof(nid_t); > + *lblk_bits_ret = 8 * sizeof(block_t); > +} > + > static const struct fscrypt_operations f2fs_cryptops = { > - .key_prefix = "f2fs:", > - .get_context = f2fs_get_context, > - .set_context = f2fs_set_context, > - .dummy_context = f2fs_dummy_context, > - .empty_dir = f2fs_empty_dir, > - .max_namelen = F2FS_NAME_LEN, > + .key_prefix = "f2fs:", > + .get_context = f2fs_get_context, > + .set_context = f2fs_set_context, > + .dummy_context = f2fs_dummy_context, > + .empty_dir = f2fs_empty_dir, > + .max_namelen = F2FS_NAME_LEN, > + .has_stable_inodes = f2fs_has_stable_inodes, > + .get_ino_and_lblk_bits = f2fs_get_ino_and_lblk_bits, > }; > #endif > > -- > 2.24.0.rc0.303.g954a862665-goog