changeset 13922:f34413c0a14e

sharepnfs: remove object and layout only if pnfs is enabled Remove object on DSs and layout on MDS only if pnfs is enabled for share. If pnfs is disabled don't do anything. Bug #1278
author Vitaliy Gusev <gusev.vitaliy@nexenta.com>
date Fri, 19 Aug 2011 02:03:14 +0400
parents 4d1d631bdb28
children b3444f462767
files usr/src/uts/common/fs/nfs/nfs41_srv.c
diffstat 1 files changed, 13 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/fs/nfs/nfs41_srv.c	Fri Aug 19 02:03:14 2011 +0400
+++ b/usr/src/uts/common/fs/nfs/nfs41_srv.c	Fri Aug 19 02:03:14 2011 +0400
@@ -3400,8 +3400,6 @@
 		 */
 		va.va_mask = AT_NLINK;
 		if (!VOP_GETATTR(vp, &va, 0, cs->cr, &ct) && va.va_nlink == 0) {
-			mds_layout_t *l;
-
 			if (in_crit) {
 				nbl_end_crit(vp);
 				in_crit = 0;
@@ -3410,18 +3408,20 @@
 			/* Need to clear nnode from cache */
 			nnode_vnode_invalidate(vp);
 
-			/* Remove the layout */
-			l = pnfs_delete_mds_layout(vp);
-
-			/*
-			 * Remove objects on data servers.
-			 * Ignore errors for now..
-			 */
-			if (l) {
-				do_ctl_mds_remove(vp, l, cs);
-				mds_layout_put(l);
+			if (pnfs_enabled(cs->exi)) {
+				mds_layout_t *l;
+
+				/* Remove the layout */
+				l = pnfs_delete_mds_layout(vp);
+				/*
+				 * Remove objects on data servers.
+				 * Ignore errors for now..
+				 */
+				if (l) {
+					do_ctl_mds_remove(vp, l, cs);
+					mds_layout_put(l);
+				}
 			}
-
 			/* Remove state on file remove */
 			if (fp)
 				rfs4_close_all_state(fp);