X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D98F93858421 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1674280676; bh=PEZoUZ1dWxMYnOO2gm7Ta7Fem2+bfLR0EYaPNi7qwb8=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=G9XFHtJOSJ0xYirHPXuLURSDcBX8bFmoxLB+6ntPPXmEusOge6TZtwcRG7qmA4n7Y T3ADX5Yq7dwXcp4HVXkDlDTvK9v4j9Mdfkg+WpRQiIYIXk81A0ULUPSI7wqh+CHh/f DScsCUpOwRZ/Wbl/SZxQvSOFxZ/Z1z/89PGmAWPk= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4DA063858D20 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bcRVWXpohq7pH/pCf5hY4jVpllYG1rgIwskeJOONwvMwWAm+Z2ZaanWGGn/SpwsUqHKXVWn4uP1U5t/aHL4u1pU0lKPImloXpO9cEhiBDHZKXyEnGe351geqwMD8hY5ahIpL835/hyiuiznw2yLqCHhozpIssdoAPCWNLzsTIqCzpTIhm3UDJRE3d7GUHPeOsIxnkowJ/qaqr/LSwOIxCl4uA7h53xO82V8qYqen9SoQ8+M0DxDlRV18inW4ix4gu/68vRaSJrTn1Uz6Jk9zSp5HTjvTmlMLqDqLuN2t/i9FsE4kp0CvMJ32eXD7r+2ZFyd5PCXNZkp5VGmjFZ3SyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sx4Ik+9YO/Z3huzNw7RASZop97KV7oN7Lr/M70BU45k=; b=nuTb/Yb4k/axpp7fHfV3lzmuWGMNNaZSjcPPtZKn5VskYz/+tr0pquOxKf22xCbHlra5jAphnmeOzhYIrs4Hi2ysIWo3EwM1G4tuknTiihjzEpJHhKSVDxWTePY9GAQQZBd0XNbXCGhSFJWuiH+5kgj5jNp7Am8cm7FeEXQnoXxMATFsy0DPYsTqnHudU+aUpyBjbkniijul+4x+GFkDln2Nff1rYqWogPOhj8K//Vb0JzealL/8KBU6NnfoXZbfSLL4Rl5kxna/dlw64/n7ByOs73/lxHwoNUaINtqZQt0XDONLBUPxoDh3gR7zTaukdoeoun+9ozAzTOpjSd+TDg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none To: "cygwin AT cygwin DOT com" Subject: fsync() cause "Invalid Argument" for block device. Thread-Topic: fsync() cause "Invalid Argument" for block device. Thread-Index: AQHZLVyTs5JBtbESTk2j98Nb1aCbCA== Date: Sat, 21 Jan 2023 05:57:35 +0000 Message-ID: Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [SyHzU7zIHcygn5r5isofTbyXvv2/msaLzR22oVN1I645wphmTu35z8eXegXkiMwF] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: TYAPR01MB6380:EE_|TYWPR01MB11232:EE_ x-ms-office365-filtering-correlation-id: f5d6ffe0-cb19-4b1b-c9bb-08dafb74652c x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: UI8+kbwKHESak6NmmF7q6qEqLDx35UA8zC6lXEQjIvRf7bYVLqURi+n+K4sUUJG6P1p4it3Jnz/whLlz1uIDhXbY/aG21UPm5sIFgZO/KGoOo8OTRnGmfby7twAMVKn69c14osxwO7WvV7B2hEk/hldQlvl3VTX/NO5dfsWKhP/Wh6naPAkVGJ69v5le9j7VDtbcvkOvBzNqoD0qZ9c78HtZgyTtP7HBn0IXACtXNGRd16AiS+A4gYbWDakqToE2qo9gXoWsDsZh9aD/teBbmpmn6rtdUZ+9QRPD3sZA98dq9pht8yEDsjwuc69zzurUIASFcTgHxyoHMCc5gNcOoUq42VksBUeGN7D6sQzAWel3MbeVyfBL4eRg7MC/ZwalhlQRgwjRVWG7IdQlr7xdFbSzr1wPqKZGfqGYHaxZlf1Yx0OBryaG4Yg/40sKXU9D8n8g0Z1VA991ex4oxwBcpLFhlE0KQwp8RdVHX7F/szH5GdtqlgR+axokL6ynz0a0YgfpsK1awszqakE58/GRCHWTviG0flUKUc4XQqKjyh4DZ8x5tyJ2av9LzeXcmQ3wlllyut1OeF7BdnMi3+qzI0YNdYNuHXeUGYyemEHYIa8= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?B?NmRkNkR0R3ozVi8vVVJ0dVJNRHpXSU9DYWZXdXdyc0MxOTNwcGFVcGdC?= =?iso-2022-jp?B?MktJK1N1YlBhSitXNmFoZVV4RnRVMDh2Tm44QlduM2JQbmlSZlVLVkJo?= =?iso-2022-jp?B?VStodHhFL0JTd1NHR3VIeFdnZzJWV2VrcnpSY3RoRjh4QVU5VE91cytj?= =?iso-2022-jp?B?RW5ZVDV3enMvZGRQUEkyT3psZjFPMUxwN1V1Tjk1NFoxbVNnZ3lxTG1v?= =?iso-2022-jp?B?N2dwRzhZd2dwN3U0RUtiT21jdE1UR1owYm9wZFFaaXBCSDh3N0ttcEJ2?= =?iso-2022-jp?B?TDRMbnZwMkxaZVl1S0VyNnl0bmFhNndZU2VDb0ljZjVKNlgzZjR0dXc1?= =?iso-2022-jp?B?RTNzcVd1V1ZWUzJrTVB2TVhEYXlaY0RtMlpYOFcxbXQzZUNPSnJYUndw?= =?iso-2022-jp?B?TWl6TUR1dGpJcUhWVU05bEN5MEJDdVlsVk02UVpLT3IyZC9CMEtrWkJR?= =?iso-2022-jp?B?bHk2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iso-2022-jp?B?QllWQ04wSWVDTmxVNVZrclkrREw0aHJEdFdrVTBIVlVmVTVteGpQT2Rt?= =?iso-2022-jp?B?aUR2S0trVTFPZzNYMXdyK0NwTnQ4dlhvZEZIWXdvMmNLSFRuQjJKZlFm?= =?iso-2022-jp?B?QUhqUUdQQlJXVDNnUUZtYVE0eUxhZk42aktxMjY0R2hKdDNKM2NCMG9u?= =?iso-2022-jp?B?UzA2R0tzZ1laZ3pEb2FtODR4QStBbFJDL0htVWp2UzlGZ3lpdThRWkRB?= =?iso-2022-jp?B?SUdTRjYzdVlTaE1GSUFxbHk2bUVRK2lDN3NjWVNlb1h1WWRSVkZVT0Fr?= =?iso-2022-jp?B?WEN0cEUySTNrSUNWYTZnZkI4Sk5oWHR3czdCMVRPbkU0dmUvR29WOVFj?= =?iso-2022-jp?B?MnBEZ1E0TTVvNjlId0dFbVJEdkpxRXNpWjQxZmRtM3ExOWxnODlNWnNF?= =?iso-2022-jp?B?OFdHMkVGZFRrWTdwcFBzSVlNZGVNelpkK0ZBWmlTbW44QmVwTS9VQ0ta?= =?iso-2022-jp?B?MEtSeUVSa2FIQVgzbXlWQVBxZWRySlNDb0wwZk0wWkJ0c3pvZEpMK21m?= =?iso-2022-jp?B?SjVJdnVwVFpCeDZtSmZsMFdLa2pIcWhxcC9aSTF5NElVRGt6MDdqY2pV?= =?iso-2022-jp?B?TT0=?= MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-9cf38.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYAPR01MB6380.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: f5d6ffe0-cb19-4b1b-c9bb-08dafb74652c X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jan 2023 05:57:35.7933 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB11232 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: Yano Ray via Cygwin Reply-To: Yano Ray Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Cygwin" Hi, I tried to format a partition using mkfs.ext4 (e2fsprogs) but it failed with an error. $ /usr/sbin/mkfs.ext4 /dev/sde1 mke2fs 1.44.5 (15-Dec-2018) Creating filesystem with 16384 1k blocks and 4096 inodes Filesystem UUID: fb09cfbf-9f2a-4874-82f7-26c7cb853093 Superblock backups stored on blocks: 8193 Allocating group tables: done Writing inode tables: done Creating journal (1024 blocks): done Writing superblocks and filesystem accounting information: mkfs.ext4: Invalid argument while writing out and closing file system $ This also seems to happen with mkfs.minix (linux-utils). $ /sbin/mkfs.minix /dev/sde1 5472 inodes 16384 blocks Firstdatazone=176 (176) Zonesize=1024 Maxsize=268966912 mkfs.minix: write failed: Invalid argument $ I think it's because fsync is not implemented (causes InvalidArgument) for block devices. Why fsync is not implemented for block devices? /* test code */ #include #include #include #include #include int main(int argc, char** argv) { int fd; if (argc != 2) { puts("./program [file]"); return -1; } fd = open(argv[1], O_RDWR); printf("open: %s\n", strerror(errno)); if (errno) return -1; fsync(fd); printf("fsync: %s\n", strerror(errno)); if (errno) return -1; } on Cygwin: $ ./a.exe /dev/sde open: No error fsync: Invalid argument $ ./a.exe /dev/sde1 open: No error fsync: Invalid argument $ uname -a CYGWIN_NT-10.0-22621 DESKTOP-5H6F7L3 3.4.5-1.x86_64 2023-01-19 19:09 UTC x86_64 Cygwin $ expected behaviour (on Arch Linux): $ sudo ./a.out /dev/sda $ sudo ./a.out /dev/sda open: Success fsync: Success $ sudo ./a.out /dev/sda1 open: Success fsync: Success $ uname -a Linux arch 6.0.11-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 02 Dec 2022 17:25:31 +0000 x86_64 GNU/Linux $ Thanks, --- Rei Yano -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple