Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Fix remaining read(fd, NULL, 1) cases.
details: https://anonhg.NetBSD.org/src/rev/c176ce6520ff
branches: trunk
changeset: 337145:c176ce6520ff
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sat Apr 04 12:34:44 2015 +0000
description:
Fix remaining read(fd, NULL, 1) cases.
diffstat:
sys/fs/msdosfs/msdosfs_vnops.c | 13 +++++++++----
sys/fs/sysvbfs/sysvbfs_vnops.c | 12 ++++++++----
sys/fs/udf/udf_vnops.c | 13 +++++++++----
tests/fs/vfs/t_io.c | 5 +----
4 files changed, 27 insertions(+), 16 deletions(-)
diffs (127 lines):
diff -r 709bc196936f -r c176ce6520ff sys/fs/msdosfs/msdosfs_vnops.c
--- a/sys/fs/msdosfs/msdosfs_vnops.c Sat Apr 04 12:32:34 2015 +0000
+++ b/sys/fs/msdosfs/msdosfs_vnops.c Sat Apr 04 12:34:44 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_vnops.c,v 1.92 2015/03/28 19:24:05 maxv Exp $ */
+/* $NetBSD: msdosfs_vnops.c,v 1.93 2015/04/04 12:34:44 riastradh Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.92 2015/03/28 19:24:05 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.93 2015/04/04 12:34:44 riastradh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -532,8 +532,13 @@
} while (error == 0 && uio->uio_resid > 0 && n != 0);
out:
- if ((ap->a_ioflag & IO_SYNC) == IO_SYNC)
- error = deupdat(dep, 1);
+ if ((ap->a_ioflag & IO_SYNC) == IO_SYNC) {
+ int uerror;
+
+ uerror = deupdat(dep, 1);
+ if (error == 0)
+ error = uerror;
+ }
bad:
fstrans_done(vp->v_mount);
return (error);
diff -r 709bc196936f -r c176ce6520ff sys/fs/sysvbfs/sysvbfs_vnops.c
--- a/sys/fs/sysvbfs/sysvbfs_vnops.c Sat Apr 04 12:32:34 2015 +0000
+++ b/sys/fs/sysvbfs/sysvbfs_vnops.c Sat Apr 04 12:34:44 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sysvbfs_vnops.c,v 1.56 2014/12/26 15:23:21 hannken Exp $ */
+/* $NetBSD: sysvbfs_vnops.c,v 1.57 2015/04/04 12:34:45 riastradh Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sysvbfs_vnops.c,v 1.56 2014/12/26 15:23:21 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysvbfs_vnops.c,v 1.57 2015/04/04 12:34:45 riastradh Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -426,7 +426,7 @@
struct sysvbfs_node *bnode = v->v_data;
struct bfs_inode *inode = bnode->inode;
vsize_t sz, filesz = bfs_file_size(inode);
- int err;
+ int err, uerr;
const int advice = IO_ADV_DECODE(a->a_ioflag);
DPRINTF("%s: type=%d\n", __func__, v->v_type);
@@ -450,7 +450,11 @@
DPRINTF("%s: read %ldbyte\n", __func__, sz);
}
- return sysvbfs_update(v, NULL, NULL, UPDATE_WAIT);
+ uerr = sysvbfs_update(v, NULL, NULL, UPDATE_WAIT);
+ if (err == 0)
+ err = uerr;
+
+ return err;
}
int
diff -r 709bc196936f -r c176ce6520ff sys/fs/udf/udf_vnops.c
--- a/sys/fs/udf/udf_vnops.c Sat Apr 04 12:32:34 2015 +0000
+++ b/sys/fs/udf/udf_vnops.c Sat Apr 04 12:34:44 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_vnops.c,v 1.97 2015/01/28 14:00:58 martin Exp $ */
+/* $NetBSD: udf_vnops.c,v 1.98 2015/04/04 12:34:45 riastradh Exp $ */
/*
* Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: udf_vnops.c,v 1.97 2015/01/28 14:00:58 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udf_vnops.c,v 1.98 2015/04/04 12:34:45 riastradh Exp $");
#endif /* not lint */
@@ -251,8 +251,13 @@
/* note access time unless not requested */
if (!(vp->v_mount->mnt_flag & MNT_NOATIME)) {
udf_node->i_flags |= IN_ACCESS;
- if ((ioflag & IO_SYNC) == IO_SYNC)
- error = udf_update(vp, NULL, NULL, NULL, UPDATE_WAIT);
+ if ((ioflag & IO_SYNC) == IO_SYNC) {
+ int uerror;
+
+ uerror = udf_update(vp, NULL, NULL, NULL, UPDATE_WAIT);
+ if (error == 0)
+ error = uerror;
+ }
}
return error;
diff -r 709bc196936f -r c176ce6520ff tests/fs/vfs/t_io.c
--- a/tests/fs/vfs/t_io.c Sat Apr 04 12:32:34 2015 +0000
+++ b/tests/fs/vfs/t_io.c Sat Apr 04 12:34:44 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_io.c,v 1.15 2015/03/28 17:45:47 riastradh Exp $ */
+/* $NetBSD: t_io.c,v 1.16 2015/04/04 12:34:44 riastradh Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -233,9 +233,6 @@
ATF_REQUIRE_EQ(rump_sys_write(fd, &ch, 1), 1);
RL(rump_sys_close(fd));
RL(fd = rump_sys_open("file", O_RDONLY | O_SYNC | O_RSYNC));
- if (FSTYPE_MSDOS(tc) ||
- FSTYPE_SYSVBFS(tc))
- atf_tc_expect_fail("bad sync atime update code path");
ATF_REQUIRE_ERRNO(EFAULT, rump_sys_read(fd, NULL, 1) == -1);
RL(rump_sys_close(fd));
FSTEST_EXIT();
Home |
Main Index |
Thread Index |
Old Index