From nobody Tue Apr 04 02:18:42 2023 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PrBJg0rRhz43h6W for ; Tue, 4 Apr 2023 02:18:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PrBJf5sLnz40xK for ; Tue, 4 Apr 2023 02:18:42 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680574722; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fWooCuxXwus5GVYbylmF6weydz0tMzkdU6OO+qgNvHQ=; b=LmTkA2npztCmdDo5bokYc5puLnynlsYQ8MzZhOI98d5jkMQChF6OaoqEKLOBFE4JGQ/t8S EYq5gTddg5OpGnA0SfhCVRkHlqvEt8suSkUMAUZESJlWegAXCcT8U3v+H0kzlQZfRAKcey 9b21V+w1O0lO4EWrVLuOGg47f8W7lrvVZlMTT0Q6Pt11m6ja4ei3nEy1GN+hnwYI3NwJa+ VB1z4nybv13cMMIc0xnxtpor5qw1A+X5nKzAp5IHfH1XGczcoaW4b4wODarAV5QLSWWGbD tWiG+0OF/1rQhc7+cm+hQb2d13sWeBwmA6K063mN1fM2SMvlNRcAxEz6SY1kVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1680574722; a=rsa-sha256; cv=none; b=tD4CnGBtlDeE0xXLdJO0b8KH1jcAhop9DMV+l/o/ApsxHZtLX1mO6VMVDm/yJqppEFThk5 //BHB3x5ibRNWEGItKnB7DSpt6Uplwdmcknkap4BCg4vy8va4MRZl05U5VGMPZXtcJYYnt gzpyaSwUE5ckNPQfYSDCSo9fxOe57pDJHvB8eaXTj/agO98C7QNSwuzhTWC1o+uRckHyx+ cNgNRnuKviyz75ivhgKZMbTnpFX/k+4XRKzTNPlwrPh8l/PtlS7soBthqiRRqSwzWyIoLx VY4rGG9VFNk3nw4PPvyD2p8eFuboiQK2LubeRPcGNYAYa/RygX+ZEXIlE/ovjQ== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PrBJf4vDDzMXX for ; Tue, 4 Apr 2023 02:18:42 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 3342IgFH031786 for ; Tue, 4 Apr 2023 02:18:42 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 3342Igvh031785 for bugs@FreeBSD.org; Tue, 4 Apr 2023 02:18:42 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 270632] [ext2fs] files <4096 bytes are corrupted on ext4 filesystems Date: Tue, 04 Apr 2023 02:18:42 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: rajeev_v_pillai@yahoo.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D270632 Bug ID: 270632 Summary: [ext2fs] files <4096 bytes are corrupted on ext4 filesystems Product: Base System Version: 13.2-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Many People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: rajeev_v_pillai@yahoo.com Files smaller than 4096 bytes (probably the ext4 block-size?) get corrupted when they're written to if the filesystem is ext4. ext2 and ext3 FSes look OK. $ uname -a FreeBSD 13.2-RC6 FreeBSD 13.2-RC6 releng/13.2-n254616-a92e3fa2ade5 GENERIC amd64 # Create an ext4 FS somewhere--here on an USB thumb drive (problem first noticed # on an existing ext4 FS on a HDD). gpart destroy -F da0 gpart create -s GPT da0 gpart add -t linux-data da0 mke2fs -L thumbdrive -t ext4 /dev/da0p1 # Copy/create a file <=3D 4096 bytes on FS (files >4096 bytes are unaffecte= d). mount -t ext2fs /dev/da0p1 /mnt echo 'hello world' >/mnt/a.txt # Without unmounting and remounting the FS, edit the file, making a trivial change, # eg. replacing any char. with the same one. # The issue does not occur if you unmount and remount the FS first before editing # the file. ed -s /mnt/a.txt <<\EoF 1s/./&/ wq EoF # Check file cat /mnt/a.txt umount /mnt # Remount & check file again. mount -r -t ext2fs /dev/da0p1 /mnt # File contents are replaced with NULs. File size is unchanged. e2fsck shows # no problems. hexdump -C /mnt/a.txt umount /mnt --=20 You are receiving this mail because: You are the assignee for the bug.=