Module Name: src Committed By: hannken Date: Sat Apr 23 08:23:52 UTC 2011
Modified Files: src/sys/ufs/ffs: ffs_snapshot.c Log Message: ffs_snapshot(): return an error if the node is an invalid snapshot. To generate a diff of this commit: cvs rdiff -u -r1.112 -r1.113 src/sys/ufs/ffs/ffs_snapshot.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/ufs/ffs/ffs_snapshot.c diff -u src/sys/ufs/ffs/ffs_snapshot.c:1.112 src/sys/ufs/ffs/ffs_snapshot.c:1.113 --- src/sys/ufs/ffs/ffs_snapshot.c:1.112 Mon Apr 18 07:36:13 2011 +++ src/sys/ufs/ffs/ffs_snapshot.c Sat Apr 23 08:23:52 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ffs_snapshot.c,v 1.112 2011/04/18 07:36:13 hannken Exp $ */ +/* $NetBSD: ffs_snapshot.c,v 1.113 2011/04/23 08:23:52 hannken Exp $ */ /* * Copyright 2000 Marshall Kirk McKusick. All Rights Reserved. @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.112 2011/04/18 07:36:13 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.113 2011/04/23 08:23:52 hannken Exp $"); #if defined(_KERNEL_OPT) #include "opt_ffs.h" @@ -197,7 +197,9 @@ /* * If the vnode already is a snapshot, return. */ - if ((VTOI(vp)->i_flags & (SF_SNAPSHOT | SF_SNAPINVAL)) == SF_SNAPSHOT) { + if ((VTOI(vp)->i_flags & SF_SNAPSHOT)) { + if ((VTOI(vp)->i_flags & SF_SNAPINVAL)) + return EINVAL; if (ctime) { ctime->tv_sec = DIP(VTOI(vp), mtime); ctime->tv_nsec = DIP(VTOI(vp), mtimensec);