Date: Wed, 14 Oct 2009 11:11:59 GMT From: Gleb Kurtsou <gk@FreeBSD.org> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/139597: [patch] [tmpfs] tmpfs initializes va_gen but doesn't update it on vnode change Message-ID: <200910141111.n9EBBxAH045695@www.freebsd.org> Resent-Message-ID: <200910141120.n9EBK1Qn011489@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910141111.n9EBBxAH045695>