From owner-freebsd-bugs@freebsd.org Mon Aug 29 18:24:19 2016 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BEACBC77EB for ; Mon, 29 Aug 2016 18:24:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 319B266E for ; Mon, 29 Aug 2016 18:24:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u7TIOJJq041102 for ; Mon, 29 Aug 2016 18:24:19 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 212245] ZFS volume (zvol) does not honor fsync() Date: Mon, 29 Aug 2016 18:24:19 +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: 10.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: lordcrc@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-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 cc attachments.created 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 MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2016 18:24:19 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D212245 Bug ID: 212245 Summary: ZFS volume (zvol) does not honor fsync() Product: Base System Version: 10.3-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: lordcrc@gmail.com CC: freebsd-amd64@FreeBSD.org CC: freebsd-amd64@FreeBSD.org Created attachment 174200 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D174200&action= =3Dedit Program used to reproduce the issue It seems that ZFS does not honor fsync() done on zvols. This issue affects iSCSI targets backed by ZFS volumes, which are forced to= run with sync=3Dalways to ensure consistency. Running sync=3Dalways has a drast= ic performance impact. To reproduce: - Log in via remote SSH console (important). - Create a ZFS pool and a zvol. - Format zvol with UFS. - Mount zvol UFS partition. - Cd into mount point. - Compile and run the attached program. - Physically remove power to the computer. - Write down the last number shown in the SSH console window. - Reboot computer and log in. - Mount zvol partition if needed. - Cd into mount point. - Display contents of "output.txt" - Compare last line of "output.txt" with last line shown in SSH console. Expected output: If the SSH console's last number was 11291, the last number in "output.txt" should be 11291 or 11292. Actual output: The last line in "output.txt" is a lot further behind the output in the SSH console. Here's the commands I used to set up the UFS partition: History for 'tank0': 2016-08-29.19:39:35 zpool create tank0 /dev/ada0s2 2016-08-29.19:43:57 zpool import tank0 2016-08-29.19:44:50 zfs create -V 500M tank0/testvol gpart add -t freebsd-ufs -a 1M /dev/zvol/tank0/testvol newfs -U /dev/zvol/tank0/testvolp1 mkdir test mount /dev/zvol/tank0/testvolp1 test The supplied program shows the expected output if run directly on a "native" UFS partition, as well as when run on a zvol using ZFS-on-Linux (on a Debian machine). --=20 You are receiving this mail because: You are the assignee for the bug.=