Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1458189pxb; Fri, 6 Nov 2020 10:05:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJyPZla7oLd0shI/vW7Zo6WHIEWVWJRX1Rayljjxd7haOHE6fm11U4jlIKFerU+gXoFvVQkQ X-Received: by 2002:a50:bb25:: with SMTP id y34mr3151626ede.249.1604685931563; Fri, 06 Nov 2020 10:05:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604685931; cv=none; d=google.com; s=arc-20160816; b=pJkQCFZ9dGtZg0M4qhn6suYEXbkSrMWyZIliwQ1Q9BPkHTE3/o0wlM9mHV3MBAU9be 6xmkA/OXOtuY7amBsnDyTbzwrNikn4XpxWUjs4slTY1i7hH9sOux3vgK0DwZcQ0Coh9S yyV7IPm0WeFnenGKhX1+2yCQI4686uZoQ051jDU4uQKtPZDVMYLLVDHWlSFIGwJNWtld TtJONzUmXp+yrr/CCnLggMm9B6q8Csc2Yn88+w7CxwzI7ToY+S/umfMnnWJMR4ucSsQ3 UXkVm7MAmlstE6QAGcrgZ/rD3miIRbjZ4Ec5eKBXeGPGNcqEKAsSQB7OQyBQBCXu5pTf Rl/g== 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=aUPdH8lqF1U5xqwtezkqrwLs2bAokk4ppnb97Ju/z64=; b=ijD3/eUXvpqqGRFf3RNniIOx44CQJ5rWwNBkJUGBhjT7PjFg0sA5JO9F6LvjZrQN6O EfC7WmiyU1BqWHE4i5Q3MoyHL8h/eXSIPKu8MlZl0QJoYd9Jl4wjVLxbgqI0B+IQzleL 6o0zgdl5ZH2S1gdq5Hq1EqssNQWV6fCNO0EEH/h/NWG2VL9UEVrdBB4q3gkeVhEMUzJY ambWgyn+4S6G6tOprjlnLVnlRYPmEkyhBP2VlgYrvrhYoB2CV8++tCeg0Gyd31kl6bfi h2Tp3hUM+f2ingQbHTqUenuzaEfWumCDUyGrRmLu6DK6LBP2nX8H8l64WS9oQuSND5Fn RXhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gI78ZZSZ; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i18si1340188ejg.625.2020.11.06.10.05.06; Fri, 06 Nov 2020 10:05:31 -0800 (PST) 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=@kernel.org header.s=default header.b=gI78ZZSZ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727768AbgKFSD1 (ORCPT + 99 others); Fri, 6 Nov 2020 13:03:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:33028 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727679AbgKFSD1 (ORCPT ); Fri, 6 Nov 2020 13:03:27 -0500 Received: from sol.localdomain (172-10-235-113.lightspeed.sntcca.sbcglobal.net [172.10.235.113]) (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 175C4206FA; Fri, 6 Nov 2020 18:03:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604685806; bh=c1ZlbAy1XM/jjZj1v4QY9q6mR0aO6Q1rz0TZUyEWckE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gI78ZZSZ/W0SrbT6UwXYvyuQNl3AOtI+Tj6hwuWBh+K0nvt9kVyRNkGJiYOc9nCyT Y2vGkrdAaQQTunN+qlGgCVNKr6N2ojO+bR5BhkB28Rna6qavd0ocabTxphfxl7Uvtr 1SjmvjpbZt+r/ARA+sFdhtq0OoMKLbcdTpwZVles= Date: Fri, 6 Nov 2020 10:03:24 -0800 From: Eric Biggers To: Chao Yu Cc: jaegeuk@kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [f2fs-dev] [PATCH v4 2/2] f2fs: fix compat F2FS_IOC_{MOVE, GARBAGE_COLLECT}_RANGE Message-ID: <20201106180324.GA78548@sol.localdomain> References: <20201106065331.76236-1-yuchao0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201106065331.76236-1-yuchao0@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 06, 2020 at 02:53:31PM +0800, Chao Yu wrote: > +#if defined(__KERNEL__) > +struct compat_f2fs_gc_range { > + u32 sync; > + compat_u64 start; > + compat_u64 len; > +}; There's no need to use '#if defined(__KERNEL__)' in kernel source files. Likewise for compat_f2fs_move_range. > +static int f2fs_compat_ioc_gc_range(struct file *file, unsigned long arg) > +{ > + struct f2fs_sb_info *sbi = F2FS_I_SB(file_inode(file)); > + struct compat_f2fs_gc_range __user *urange; > + struct f2fs_gc_range range; > + int err; > + > + if (unlikely(f2fs_cp_error(sbi))) > + return -EIO; > + if (!f2fs_is_checkpoint_ready(sbi)) > + return -ENOSPC; I still don't understand why this checkpoint-related stuff is getting added here, and only to the compat versions of the ioctls. It wasn't in the original version. If they are needed then they should be added to __f2fs_ioc_gc_range() and __f2fs_ioc_move_range() (preferably by a separate patch) so that they are done for both the native and compat versions of these ioctls. - Eric