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=1796102346; b=h9szZw2nudX57mWvxGJVh2djR7MoBA9A+MSW/j8VdnYVia2mHWepo72f1tvx1Uolhw64 ZT8kPJc+ggUgYgS3+solOLiHVfHdbV1NKu9eVCiVMOlD45LcWmkPgXydIP5jeuHSJR7Qp JqrALs7b6SLiWyg2Zj8xlHD5FwcPBgawzI9dlK52pxLlo1i2vonlZOkFrSnqLcDxz3/x3 tBEP2/jtghJS9ExQXGaVEgq6X13OPBED8PK1VdgXmJ9+4zvtItR44q0QCPMDw4YALlFLR gymYf+HVkX4OkNE17KCxa0T+MGeUf5ZLTB+aNBtfJ0EGMDUE+RLiDkM/u3XBYV2OohA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796102346; 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=kXMajVQRQHhiOHaRgk/3aM8EBe4WhxlWGWTiQ+Zylfohk+mZRn7MssVp4Oc1HIelSmaE nIJ8df6S1z+l4MPfLZyHvFu2PP92lPe7r8qqD+jjWxUlKYwX7T16k5DB+Ewx8K+vza/UF 5Yqu4pdSADbvu0KnwBEmxzMCeWFJZygu7TovA1aGW4tTS2BF17Nat1H9hU8BbOEGPJN5Q vUTPRqkIWS+A1dN4arHJ4LMLYaV9brixw29l6P1whVT8mNYJ/Ele4Mt62Lq1VtQiT0E2I S1WzItFt+hByM+GNXdiiaReLjNj1X/bgo7Nu0okc2X+qsCGWogHnNppBpJecWngT3fw== 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 02751606A327 for ; Tue, 1 Dec 2026 05:19:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 02751606A327 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) 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-kernel@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