From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=18.9.28.11 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796102345; b=L1SG1badxr8tg8Jsjx+xBkm0Fl61z1BjycN+/Xsj/H2dXnoXqqKc02GMTY8CIaacqnuq yvBNHjdxNajdSHtI3zvZKF2tr/C6MdBsgCQg7q/v+7KCzlFlD7jPPPmxExQMfTE7J27/A uD51NfujnbMTz9D35w81gZHiyhDbrTu9/k2IzJK2X3imHTiG0aTq2BY/xpRyWrGMKDzye 9wjL2TOiouvHFoDmsjHeNzKwxcAF5YG0YAz/mIhMGnXbrBT+H1OjdJ2cp3ERAx4BKmFbm xhijAzp1fFQnkc3tZxz9youRLQSnGvVjiFdMvHvoRkTwMkRrSIXnX66ipIO6ti94Mkw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796102345; h=DMARC-Filter:Received:DKIM-Signature:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=7HUSj6A6dpMZCiVIR3QsodicYOHUU6OeW4YvJSyZi0U=; b=Nn4Hh94KR81Lah2D5lKx+SEYtHTDGitMaxSZm4dCCyWzTIMXgMPRa9uBIijkGKZjwmEb KkYgYMGVmDyYPKzVWZEVHKDIClb4yc/a60UGIzKYCllsuZx09gHWFiaQ/7FGKzDjAaLBV O8rMTfH8eyWWY0l3dx8EXMqNjWRUbx/i7s/kCW455Klw08pC8jjB/D5Q+BB37yiSlE79F vC4vVG0KeZj1XsS1SNX/A5SJzUNyauheIbbSkknYUv65Ez6pYcJM4LN8lWG7aH63YxJ7d nBen3J02VlCWYnZzFFaGZJwf8inT8g4nvljw4bp/fIuDCkniupnlJnwCXmt8PO2X4aA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=mit.edu; spf=pass smtp.mailfrom=mit.edu; dkim=pass header.d=mit.edu header.i=@mit.edu header.a=rsa-sha256 header.s=outgoing header.b=MA+Br20k; arc=none smtp.remote-ip=18.9.28.11 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED462606A31A for ; Tue, 1 Dec 2026 05:19:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org ED462606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mit.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mit.edu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=mit.edu header.i=@mit.edu header.a=rsa-sha256 header.s=outgoing header.b=MA+Br20k Received: from macsyma.thunk.org (pool-173-48-111-149.bstnma.fios.verizon.net [173.48.111.149]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 6B15Ipg2011770 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 1 Dec 2026 00:18:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1796102332; bh=7HUSj6A6dpMZCiVIR3QsodicYOHUU6OeW4YvJSyZi0U=; h=Date:From:Subject:Message-ID:MIME-Version:Content-Type; b=MA+Br20kQja/8VxHrBOm3iCinis2RLK+D7ZB71f668vLUy5/vZg2h0Qgw2o/ulA6a CT4lSVb0DvqCO6bpeAWqh+j5S3NaSFBgvI9qTBVw8sE9W2tVdRpZRjwdfE5XK7OKhl u4YSfHdy74pRd5rgt/q0Du+pspDSV8zeKwzHoDzD2y5fWXLQE3T6XcB8I2s8ClRJzQ zq7Uvgh5CZocy5KlRzN7Rp/rnOojQtk3ypQcPNncqJp2JiOnBoIc93xvPM7jRAfLq+ gkjmEvNTcurwbiOug28P7mCnDJV2raay+sWT0bkKIhMeZsw9LyWHBlllpsZZ8u3bJD tJkRUZ8R7/0dw== Received: by macsyma.thunk.org (Postfix, from userid 15806) id EF1802A618E4; Tue, 1 Dec 2026 00:18:50 -0500 (EST) Date: Tue, 1 Dec 2026 00:18:50 -0500 From: "Theodore Tso" To: Guikun Yang Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [Bug report] ext4: EXT4_IOC_MOVE_EXT with len == 0 clamps the length to the whole origin file and overwrites the donor Message-ID: References: X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Dec 01, 2026 at 12:40:00AM -0500, Guikun Yang wrote: > Hi Ted, Jan, > > A regular (non-corrupted) ext4 filesystem lets EXT4_IOC_MOVE_EXT with > me.len == 0 destroy the donor file's data. The ioctl returns 0 with > moved_len == 1; after a remount the donor file is left empty and > e2fsck reports a clean filesystem throughout. Why should we care about the donor file's data? The normal path is that e4defrag allocates blocks associated with the new donor inode, and if the donor inode is more contiguous than the target inode, we then copy the contents of the target inode to the blocks in the donor inode, and then the those blocks are assigned to the target inode --- and then e4defrag will delete the the donor inode. IF the file system gets corrupted, or the data in the target inode is getting corrupted, that would be really serious. Your bug report is focused onthe donor inode, and not what is happening with the target inode. So there may be a problem here, but it appears that it's not terribly serious. What am I missing? - Ted