kern/139597: [patch] [tmpfs] tmpfs initializes va_gen but doesn'

看板FB_bugs作者時間16年前 (2009/10/14 19:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
>Number: 139597 >Category: kern >Synopsis: [patch] [tmpfs] tmpfs initializes va_gen but doesn't update it on vnode change >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Oct 14 11:20:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Gleb Kurtsou >Release: >Organization: >Environment: FreeBSD tops 9.0-CURRENT FreeBSD 9.0-CURRENT #10 r198029+5e4f6c4: Tue Oct 13 20:24:19 EEST 2009 root@tops:/usr/obj/usr/freebsd-src/local/sys/TOPS amd64 >Description: tmpfs initializes tn_gen (generation number) on node creation, but fails to update it on vnode change. other filesystems set va_gen=0 or update it on changes (ufs, zfs) >How-To-Repeat: mount pefs or nfs (not tested) on top of tmpfs >Fix: Patch attached with submission follows: diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 8dc8338..3df61f8 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -1252,6 +1252,10 @@ tmpfs_itimes(struct vnode *vp, const struct timespec *acc, if (node->tn_status & TMPFS_NODE_CHANGED) { node->tn_ctime = now; } + if (node->tn_status & (TMPFS_NODE_MODIFIED | TMPFS_NODE_CHANGED)) { + if (++node->tn_gen == 0) + node->tn_gen = arc4random() / 2 + 1; + } node->tn_status &= ~(TMPFS_NODE_ACCESSED | TMPFS_NODE_MODIFIED | TMPFS_NODE_CHANGED); } >Release-Note: >Audit-Trail: >Unformatted: _______________________________________________ freebsd-bugs@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@freebsd.org"
文章代碼(AID): #1ArRQppK (FB_bugs)