Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1873306pxb; Sat, 7 Nov 2020 01:29:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJyyHrMZYH10z64D/fT7Uzh9hp4xMV/cqtv6JtaB0RVA6iu8jOR5RyCwBnTTjluXNC3zJQtb X-Received: by 2002:aa7:d3c3:: with SMTP id o3mr6395320edr.319.1604741383045; Sat, 07 Nov 2020 01:29:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604741383; cv=none; d=google.com; s=arc-20160816; b=LA18j5KTRzJUftvbKfT6YK75Nq3erLnqNBC7+/T5SPFalmHKiCmlwkAiVIlgw3KsZ/ c8vaaJ4a1TxyallJzZzKEE/sAO2pW7fIoo6Fd1eRkw7A5DnK/laGOV+C9S9FR4ylOF89 i23MFR4Uh0KWZnIsSjoKmW3NARUst52wsSrFahphX/7fOkzkCvuvr37FM+9LOya/Soid R7wv1GrA/hOWMoerOEXmsV2gDboKvCHOxshMfdAC0vmUz6Ij17lqg/KRlYUG2vI1C5xx TFVh5wzOt7Bsy1EOqoJLV8xpWg6Wpn/ahInplKXSIqx+sqbxdhQokOn/ItX6/2BOa2Sv ilMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from:dkim-signature; bh=W2/CyyXHzEAAhdnnosQA++0ESZ+WiSpb9L+D6RhWHKE=; b=CQ4Kst3uww1iys0m0OjnSnl50MtIY/XPSxnFLrDahH3glqj4YIqJ2Fae9DgP9dX5gr g4YeICUqbDjcL1MixKzGQBJBllouovrmY4CMy7dYryEkMBJxs4i6VCUg/oZCJQ/k+EMv T6/gddEGv/B/USeudIVaUMOB/0NTr/OglHboOAhRM5jozfXnW8A0sUdNHRukFUCFGIe1 J39/dvFb12JQMAEA3oW1aWSRwYlc5EW7A7M49K13qnuvTUQtYIvl2lNT4LDcgFyQDX+A fGztJlbd7iaBYv5AQXiuXILJi7U6DkCYt4JOdWKkc1YvByeOFi0Ng8xNOA9VqVXlg/xx kyFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=V78g9n4P; 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 j12si2817334ejt.283.2020.11.07.01.29.20; Sat, 07 Nov 2020 01:29:43 -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=V78g9n4P; 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 S1727969AbgKGJZ2 (ORCPT + 99 others); Sat, 7 Nov 2020 04:25:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:39592 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727810AbgKGJZ1 (ORCPT ); Sat, 7 Nov 2020 04:25:27 -0500 Received: from [192.168.0.113] (unknown [117.89.214.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 733BF20719; Sat, 7 Nov 2020 09:25:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604741127; bh=iqpA6o35pg+nbMb5DHnGD+JQW+uCz/XmulgnMdR5h2c=; h=From:Subject:To:Cc:References:Date:In-Reply-To:From; b=V78g9n4PnmWuyNsGps29ODYrO88XCFjh1LRUbIDP8HTFqBncFcQv/dgtDrbIBA4Bj JA/LYIYiHHhszX300/tLH4kENFN2RlmHt4d9tylqitlpT72h7GDYwNB8+QsJzmiyKW K03db7oG1Lp8Mo1me9HYrrXb2ve8Ov1CrDG0+mJ0= From: Chao Yu Subject: Re: [f2fs-dev] [PATCH v4 2/2] f2fs: fix compat F2FS_IOC_{MOVE, GARBAGE_COLLECT}_RANGE To: Eric Biggers , Chao Yu Cc: jaegeuk@kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net References: <20201106065331.76236-1-yuchao0@huawei.com> <20201106180324.GA78548@sol.localdomain> Message-ID: Date: Sat, 7 Nov 2020 17:25:23 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.1 MIME-Version: 1.0 In-Reply-To: <20201106180324.GA78548@sol.localdomain> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/11/7 2:03, Eric Biggers wrote: > 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. Correct. > >> +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 If so, cp-related stuff will be checked redundantly in both f2fs_ioctl() and __f2fs_ioc_xxx() function for native GC_RANGE and MOVE_RANGE ioctls, it's not needed. Thanks, > done for both the native and compat versions of these ioctls. > > - Eric > > > _______________________________________________ > Linux-f2fs-devel mailing list > Linux-f2fs-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel >