diff options
| author | Bryan Cantrill <bryan@joyent.com> | 2012-08-03 19:23:29 +0000 |
|---|---|---|
| committer | Bryan Cantrill <bryan@joyent.com> | 2012-08-03 19:23:29 +0000 |
| commit | 12ef7bd6596eedcaafd544ec675d6b72dfd15998 (patch) | |
| tree | 36806bf6158fa7ba2f411f590c8d66f25c58d8b5 /usr/src/uts/common/fs/tmpfs/tmp_vnops.c | |
| parent | 9e857228fdc0128410f9aec8c9e410612e8bd96e (diff) | |
| download | illumos-joyent-12ef7bd6596eedcaafd544ec675d6b72dfd15998.tar.gz | |
OS-1429 `tail -f ...` doesn't notice file truncation
Diffstat (limited to 'usr/src/uts/common/fs/tmpfs/tmp_vnops.c')
| -rw-r--r-- | usr/src/uts/common/fs/tmpfs/tmp_vnops.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/usr/src/uts/common/fs/tmpfs/tmp_vnops.c b/usr/src/uts/common/fs/tmpfs/tmp_vnops.c index 61d72a4015..461016aa52 100644 --- a/usr/src/uts/common/fs/tmpfs/tmp_vnops.c +++ b/usr/src/uts/common/fs/tmpfs/tmp_vnops.c @@ -24,6 +24,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012, Joyent, Inc. All rights reserved. + */ + #include <sys/types.h> #include <sys/param.h> #include <sys/t_lock.h> @@ -978,6 +982,8 @@ again: } if (error == 0) { /* name found */ + boolean_t trunc = B_FALSE; + ASSERT(oldtp); rw_enter(&oldtp->tn_rwlock, RW_WRITER); @@ -1005,6 +1011,7 @@ again: rw_enter(&oldtp->tn_contents, RW_WRITER); (void) tmpnode_trunc(tm, oldtp, 0); rw_exit(&oldtp->tn_contents); + trunc = B_TRUE; } rw_exit(&oldtp->tn_rwlock); if (IS_DEVVP(*vpp)) { @@ -1019,9 +1026,9 @@ again: *vpp = newvp; } - if (error == 0) { + if (trunc) vnevent_create(*vpp, ct); - } + return (0); } |
