From nobody Sat Nov 26 20:55:44 2022 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 4NKPC46l1Hz4j3hS for ; Sat, 26 Nov 2022 20:55:44 +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 4NKPC44bM3z4Lgv for ; Sat, 26 Nov 2022 20:55:44 +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=1669496144; 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=nu1gEKshv1KjjSkxk0eSEDkvBbl/SGvVIvmAAg6jecw=; b=RVkroQB8/dLsrfg/32S8fdqz4rexJvbR5DZuCOQmtsNHcd4Y5bl/gjaju0i+w19gv+/lYX hyBFebqulEE3DFbbh57wg6HoF5BAY8ExYf4BpOa3dzXwzHJ64D66i+y1o95FeI2V/taCKA xhS28Xgp/jbz8WOHmO7EBspM8hUBI9RrUy2/LdgtvKna6ewGFjnPkpKLDcl6+aStoRWwRR LE8zICC2dZhS4cglEviobMfIUBZPOWuIMStUu6bjiGXFweHc26j3gTo7ZTth8HJTklsmLy NGoS29tf5B/aFkL4YMZYFkOydaZMFbXcRp69r3nJ+Rq7tFlfKS09BKc7BLI4Rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669496144; a=rsa-sha256; cv=none; b=r1sZqd87V3pnwbzAnD69Q4LD8O8ZeBqHe9ZaJVYySGpV6Zq8vtnsHFJcWkxbgIajR5EU6s CeWtbEcJomr0/vLasXUzEOHQ2pova7OOq75ZqrCk+7JES6kg2zc5egTumVZLC7FnRdLbLD 7mEI2AgEKd1bf9OF8Z9bCqE+w3rmQopqsZCD+62Lsq+mOp+bNhgRtDeyUCtfqAVbao9kc3 uwuydLKKS8NMsAsx11Ytld2PdbL+BhEVNMkXXB1Yfx5PcZwNFZEdXYpzjGqPk6/0rQY4kh rvopU7oUHrAF907GALWbFvbKAgDW04db9fQqPuaDFME20tq1ahIqrZglSoqHag== 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 4NKPC43dGlzYQ8 for ; Sat, 26 Nov 2022 20:55:44 +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 2AQKtiRf087967 for ; Sat, 26 Nov 2022 20:55:44 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2AQKti4i087966 for bugs@FreeBSD.org; Sat, 26 Nov 2022 20:55:44 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 268005] rsync to FAT32 flash drive gets "Freeing unused sector" errors Date: Sat, 26 Nov 2022 20:55:44 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: 13.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: wbe@psr.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=3D268005 Bug ID: 268005 Summary: rsync to FAT32 flash drive gets "Freeing unused sector" errors Product: Base System Version: 13.1-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: misc Assignee: bugs@FreeBSD.org Reporter: wbe@psr.com Summary: rsync copying to a mounted FAT32 flash drive is getting "Freeing unused sector" errors. First seen Sept. 10. Keywords: msdosfs, rsync, flash drive, "Freeing unused sector" What fails: * rsync from HDD to a mounted FAT32 flash drive. * The error is always kernel: "Freeing unused sector". Things worked fine under FreeBSD 13.0-RELEASE-p12 for amd64 and (I think) rsync 3.2.5. * The system was upgraded to FreeBSD 13.1-RELEASE-p2 and rsync 3.2.6 on 8/3= 1. The problem first appeared on 9/10. As of -p4, it is still occurring. * It doesn't always happen (see below), but some cases are more likely to trigger the problem. Related things that haven't experienced the problem: * rsync to flash drives with a UFS file system continues to work fine. The problem has only appeared with flash drives using MSDOS/FAT32. * cp -pR of gigabytes of data from HDD to the FAT32 flash drive did fine. I've only seen the problem arise when using rsync. More: * I cp'd the flash drive's 7.1GB of files to HDD, did a complete reformat of the drive (not a "quick" format), and cp'd all the saved files back. That all went fine. I then ran rsync and the error arose again relatively quickly. * After getting the unused sector error, I ran Win10's "Scan and Repair" on= the drive. It says "Your drive has been successfully repaired", indicating t= hat the corruption, however it happened, appears to be real. * Reading from the drive seems to work fine. Discussion: At first, since it was happening with an old 8GB flash drive I'd used for years, I figured maybe it was just wearing out. So, I got a brand new, fresh out = of its package, 16GB flash drive. rsync ran for good while but the same error ("Freeing unused sector") happened. Once again, Win10 "Scan and Repair" sa= id successfully repaired, indicating there was at least one problem. [It says= no errors if there were no errors.] I *don't* believe the new drive is hardware flaky. I especially don't beli= eve a brand new flash drive would be the exact same kind of flaky as the old driv= e. This is what leads me to think some sort of bug has crept in to either FreeBSD's msdosfs code or rsync (or one of its libraries). Log file details: The first occurrence: {mildly edited} [I plug in the old USB flash drive] Sep 10 09:31:17 kernel: usb_msc_auto_quirk: UQ_MSC_NO_GETMAXLUN set for USB mass storage device UFD USB Flash Drive (0x{#}:0x{#}) Sep 10 09:31:20 kernel: usb_msc_auto_quirk: UQ_MSC_NO_PREVENT_ALLOW set for= USB mass storage device UFD USB Flash Drive (0x{#}:0x{#}) Sep 10 09:31:20 kernel: ugen2.6: at usbus2 Sep 10 09:31:20 kernel: umass0 on uhub2 Sep 10 09:31:20 kernel: umass0: on usbus2 Sep 10 09:31:20 kernel: umass0: SCSI over Bulk-Only; quirks =3D 0x8100 Sep 10 09:31:20 kernel: umass0:6:0: Attached to scbus6 Sep 10 09:31:23 kernel: da0 at umass-sim0 bus 0 scbus6 target 0 lun 0 Sep 10 09:31:23 kernel: da0: Removable Direct Ac= cess SCSI device Sep 10 09:31:23 kernel: da0: Serial Number {its serial #} Sep 10 09:31:23 kernel: da0: 40.000MB/s transfers Sep 10 09:31:23 kernel: da0: 7648MB (15663104 512 byte sectors) Sep 10 09:31:23 kernel: da0: quirks=3D0x2 [mount_msdosfs is run to mount da0s1 on my mount point.] [I run rsync] Sep 10 09:50:32 kernel: {mymountpoint}: Freeing unused sector 983552 0 0 Sep 10 09:50:32 kernel: /dev/da0s1: remounting read-only due to corruption Here are error lines from other times (same flash drive). The sector info changes: Sep 20 17:32:28 kernel: {mymountpoint}: Freeing unused sector 457900 12 fe000000 and Nov 21 00:19:09 kernel: {mymountpoint}: Freeing unused sector 8816 16 b3c07= fff and Nov 26 00:56:50 kernel: {mymountpoint}: Freeing unused sector 185786 26 da000000 This last one occurred following the complete reformat, so there shouldn't have been any file system problem at mount time. Today, the same problem happened with the brand new drive: Nov 26 08:07:11 kernel: da0: 14976MB (30670848 512 byte sectors) Nov 26 10:10:18 kernel: {mymountpoint}: Freeing unused sector 957732 4 ffff= fe00 and a bit later: Nov 26 14:18:49 kernel: {mymountpoint}: Freeing unused sector 943666 18 fffbaf7f What seems to make the problem more likely to occur: On the old drive, the majority of the files hadn't changed since the previo= us rsync, so rsync did lots of reading and comparing, but not that much writin= g. The problem occurred. The first time I ran rsync with the new drive, none of the old files were there, so rsync was mostly writing some 7GB. That went fine, just like the 7GB cp= to the old drive went fine. Then, the second time, I'd changed the rsync comm= and to include 2 directories I'd excluded the first time, and it was while writ= ing those files that it died with the log entries above. For now, it looks like rsync to a FAT32/512 flash drive is unreliable. I hope this can get fixed. -WBE --=20 You are receiving this mail because: You are the assignee for the bug.=