From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AAF4C433EF for ; Fri, 22 Oct 2021 18:41:34 +0000 (UTC) Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1E5D461181 for ; Fri, 22 Oct 2021 18:41:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1E5D461181 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=oss.oracle.com Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19MI2maC029481; Fri, 22 Oct 2021 18:41:33 GMT Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3bunvd3nhf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Oct 2021 18:41:31 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 19MIQ2i4148321; Fri, 22 Oct 2021 18:41:19 GMT Received: from oss.oracle.com (oss-old-reserved.oracle.com [137.254.22.2]) by userp3020.oracle.com with ESMTP id 3br8gyc3cr-1 (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO); Fri, 22 Oct 2021 18:41:18 +0000 Received: from localhost ([127.0.0.1] helo=lb-oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1mdzTh-0007U6-ML; Fri, 22 Oct 2021 11:41:17 -0700 Received: from aserp3020.oracle.com ([141.146.126.70]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1mdzTg-0007Th-As for ocfs2-devel@oss.oracle.com; Fri, 22 Oct 2021 11:41:16 -0700 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 19MIRcxj131076 for ; Fri, 22 Oct 2021 18:41:16 GMT Received: from mx0b-00069f01.pphosted.com (mx0b-00069f01.pphosted.com [205.220.177.26]) by aserp3020.oracle.com with ESMTP id 3bqpjb148j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 22 Oct 2021 18:41:15 +0000 Received: from pps.filterd (m0246578.ppops.net [127.0.0.1]) by mx0b-00069f01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19MHFgAT001500 for ; Fri, 22 Oct 2021 18:41:15 GMT Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mx0b-00069f01.pphosted.com with ESMTP id 3bv1hu0wxy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 22 Oct 2021 18:41:14 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id CDECA60238; Fri, 22 Oct 2021 18:41:10 +0000 (UTC) Date: Fri, 22 Oct 2021 19:41:07 +0100 From: Catalin Marinas To: Andreas Gruenbacher Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Source-IP: 198.145.29.99 X-ServerName: mail.kernel.org X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 mx include:_spf.kernel.org ~all X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10145 signatures=668683 X-Proofpoint-Spam-Reason: safe X-Spam: OrgSafeList X-SpamRule: orgsafelist Cc: cluster-devel , Jan Kara , Will Deacon , Linux Kernel Mailing List , Josef Bacik , Christoph Hellwig , Al Viro , linux-fsdevel , Linus Torvalds , "ocfs2-devel@oss.oracle.com" Subject: Re: [Ocfs2-devel] [RFC][arm64] possible infinite loop in btrfs search_ioctl() X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10145 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 adultscore=0 spamscore=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110220106 X-Proofpoint-ORIG-GUID: OgCNO9Tu7poZ9rc65XVM2toFUyEr0aTi X-Proofpoint-GUID: OgCNO9Tu7poZ9rc65XVM2toFUyEr0aTi On Thu, Oct 21, 2021 at 08:00:50PM +0200, Andreas Gruenbacher wrote: > On Thu, Oct 21, 2021 at 7:09 PM Catalin Marinas wrote: > > This discussion started with the btrfs search_ioctl() where, even if > > some bytes were written in copy_to_sk(), it always restarts from an > > earlier position, reattempting to write the same bytes. Since > > copy_to_sk() doesn't guarantee forward progress even if some bytes are > > writable, Linus' suggestion was for fault_in_writable() to probe the > > whole range. I consider this overkill since btrfs is the only one that > > needs probing every 16 bytes. The other cases like the new > > fault_in_safe_writeable() can be fixed by probing the first byte only > > followed by gup. > > Hmm. Direct I/O request sizes are multiples of the underlying device > block size, so we'll also get stuck there if fault-in won't give us a > full block. This is getting pretty ugly. So scratch that idea; let's > stick with probing the whole range. Ah, I wasn't aware of this. I got lost in the call trees but I noticed __iomap_dio_rw() does an iov_iter_revert() only if direction is READ. Is this the case for writes as well? -- Catalin _______________________________________________ Ocfs2-devel mailing list Ocfs2-devel@oss.oracle.com https://oss.oracle.com/mailman/listinfo/ocfs2-devel