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 X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 017ACC48BC2 for ; Thu, 24 Jun 2021 03:26:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B542C6137D for ; Thu, 24 Jun 2021 03:26:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B542C6137D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9D39A6B007D; Wed, 23 Jun 2021 23:26:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 983866B007E; Wed, 23 Jun 2021 23:26:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8249E6B0080; Wed, 23 Jun 2021 23:26:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0247.hostedemail.com [216.40.44.247]) by kanga.kvack.org (Postfix) with ESMTP id 4F2256B007D for ; Wed, 23 Jun 2021 23:26:13 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 7963D180477D8 for ; Thu, 24 Jun 2021 03:26:13 +0000 (UTC) X-FDA: 78287179026.09.BFAEF69 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf07.hostedemail.com (Postfix) with ESMTP id D32C2A0001A9 for ; Thu, 24 Jun 2021 03:26:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=nyTPVWQigA5b5LTXeTBvmNaJcqPEw9/9blpnGa8JzHY=; b=pOesFcYObMXN92+ab0Ltvyvie4 KRTMHZMvAsvWJuKFOiJDymZOlIHDjqc59KDoQhmGnqujA/34gQr9fvUFSOLIygdCcL6Raw/ENk3M7 8sipgSPfGUzqUFdid8gW0eNtWlnmjSwbo9ecdNVWgc0TwnwZNJlI8F/+2sRYF//nzuu4w/h94sMOc tOvrGVjZTkeiyag+frtveayVKCmr6NaLImJGU/wTHCjN/iV/3PNJYGksyE07BvIEnbl6LYnLG5g76 7ssBzFmqkrVWohquIQFbV1IicSzADO6Bqr8JOTrv5ZX7iPutjyGZKshP/I8bLlPvQCjHJ8V4zagme rip70Jbw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwFyw-00G7yn-HB; Thu, 24 Jun 2021 03:25:08 +0000 Date: Thu, 24 Jun 2021 04:24:46 +0100 From: Matthew Wilcox To: Chen Huang Cc: Mark Rutland , Andrew Morton , Stephen Rothwell , Al Viro , Randy Dunlap , Catalin Marinas , Will Deacon , Linux ARM , linux-mm , open list Subject: Re: [BUG] arm64: an infinite loop in generic_perform_write() Message-ID: References: <20210623132223.GA96264@C02TD0UTHF1T.local> <1c635945-fb25-8871-7b34-f475f75b2caf@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1c635945-fb25-8871-7b34-f475f75b2caf@huawei.com> Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=pOesFcYO; dmarc=none; spf=none (imf07.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Stat-Signature: cba8yw9c9471je1ghbzokdfagrpwp9hw X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D32C2A0001A9 X-HE-Tag: 1624505170-311699 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Jun 24, 2021 at 11:10:41AM +0800, Chen Huang wrote: > In userspace, I perform such operation: > > fd = open("/tmp/test", O_RDWR | O_SYNC); > access_address = (char *)mmap(NULL, uio_size, PROT_READ, MAP_SHARED, uio_fd, 0); > ret = write(fd, access_address + 2, sizeof(long)); ... you know that accessing this at unaligned offsets isn't going to work. It's completely meaningless. Why are you trying to do it?