Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/lfs Update mtime even if oip->i_size == length



details:   https://anonhg.NetBSD.org/src/rev/3320174f80a0
branches:  trunk
changeset: 822461:3320174f80a0
user:      maya <maya%NetBSD.org@localhost>
date:      Tue Mar 21 09:53:00 2017 +0000

description:
Update mtime even if oip->i_size == length

PR kern/51762, LFS version.

diffstat:

 sys/ufs/lfs/lfs_inode.c |  15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)

diffs (43 lines):

diff -r 3c26e5d85782 -r 3320174f80a0 sys/ufs/lfs/lfs_inode.c
--- a/sys/ufs/lfs/lfs_inode.c   Tue Mar 21 07:04:29 2017 +0000
+++ b/sys/ufs/lfs/lfs_inode.c   Tue Mar 21 09:53:00 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_inode.c,v 1.152 2017/03/19 22:48:00 riastradh Exp $        */
+/*     $NetBSD: lfs_inode.c,v 1.153 2017/03/21 09:53:00 maya Exp $     */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_inode.c,v 1.152 2017/03/19 22:48:00 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_inode.c,v 1.153 2017/03/21 09:53:00 maya Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_quota.h"
@@ -228,15 +228,6 @@
        if (length < 0)
                return (EINVAL);
 
-       /*
-        * Just return and not update modification times.
-        */
-       if (oip->i_size == length) {
-               /* still do a uvm_vnp_setsize() as writesize may be larger */
-               uvm_vnp_setsize(ovp, length);
-               return (0);
-       }
-
        fs = oip->i_lfs;
 
        if (ovp->v_type == VLNK &&
@@ -252,6 +243,8 @@
                return (lfs_update(ovp, NULL, NULL, 0));
        }
        if (oip->i_size == length) {
+               /* still do a uvm_vnp_setsize() as writesize may be larger */
+               uvm_vnp_setsize(ovp, length);
                oip->i_flag |= IN_CHANGE | IN_UPDATE;
                return (lfs_update(ovp, NULL, NULL, 0));
        }



Home | Main Index | Thread Index | Old Index