Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/ufs Change ufs_truncate_retry() to call UFS_TRUNCATE...



details:   https://anonhg.NetBSD.org/src/rev/66f4cb395140
branches:  trunk
changeset: 350091:66f4cb395140
user:      hannken <hannken%NetBSD.org@localhost>
date:      Wed Jan 04 10:04:17 2017 +0000

description:
Change ufs_truncate_retry() to call UFS_TRUNCATE() at least once.
Even with "newsize == ip->i_size" it must set mtime etc.

Adresses PR kern/51762 "mtime not updated by open(O_TRUNC)"

diffstat:

 sys/ufs/ufs/ufs_inode.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r c4f19320e185 -r 66f4cb395140 sys/ufs/ufs/ufs_inode.c
--- a/sys/ufs/ufs/ufs_inode.c   Wed Jan 04 04:43:08 2017 +0000
+++ b/sys/ufs/ufs/ufs_inode.c   Wed Jan 04 10:04:17 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ufs_inode.c,v 1.97 2016/10/28 20:38:12 jdolecek Exp $  */
+/*     $NetBSD: ufs_inode.c,v 1.98 2017/01/04 10:04:17 hannken Exp $   */
 
 /*
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_inode.c,v 1.97 2016/10/28 20:38:12 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_inode.c,v 1.98 2017/01/04 10:04:17 hannken Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -303,7 +303,7 @@
        /*
         * Truncate might temporarily fail, loop until done.
         */
-       while (ip->i_size != newsize) {
+       do {
                error = UFS_WAPBL_BEGIN(mp);
                if (error)
                        goto out;
@@ -313,7 +313,7 @@
 
                if (error != 0 && error != EAGAIN)
                        goto out;
-       }
+       } while (ip->i_size != newsize);
 
   out:
        return error;



Home | Main Index | Thread Index | Old Index