lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1481122518-19021-2-git-send-email-dmonakhov@openvz.org>
Date:   Wed,  7 Dec 2016 18:55:18 +0400
From:   Dmitry Monakhov <dmonakhov@...nvz.org>
To:     linux-ext4@...r.kernel.org
Cc:     tytso@....edu, Dmitry Monakhov <dmonakhov@...nvz.org>
Subject: [PATCH 2/2] ext2fs: check fsync error code

testcase: f_mke2fs_baddisk
Signed-off-by: Dmitry Monakhov <dmonakhov@...nvz.org>
---
 lib/ext2fs/unix_io.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c
index 429ea24..6c54cbe 100644
--- a/lib/ext2fs/unix_io.c
+++ b/lib/ext2fs/unix_io.c
@@ -1030,7 +1030,10 @@ static errcode_t unix_flush(io_channel channel)
 #ifndef NO_IO_CACHE
 	retval = flush_cached_blocks(channel, data, 0);
 #endif
-	fsync(data->dev);
+	if(fsync(data->dev)) {
+		if (!retval)
+			retval = errno;
+	}
 	return retval;
 }
 
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ