diff --git a/lustre/smfs/smfs_cow.c b/lustre/smfs/smfs_cow.c
index b592087460da08f4ab1724c9819f8d7d81fc4c05..bff45286810caa671e7076eab518eb44910ac71b 100644
--- a/lustre/smfs/smfs_cow.c
+++ b/lustre/smfs/smfs_cow.c
@@ -173,13 +173,14 @@ int smfs_cow_cleanup(struct super_block *sb)
 * should be recorgnized here*/
 int smfs_init_snap_inode_info(struct inode *inode, int flags)
 {
-        struct snap_inode_info *sni_info = I2SNAPI(inode);
-        struct fsfilt_operations *snapops = I2SNAPOPS(inode);
         int vallen, rc = 0;
         ENTRY;
 
         if (SMFS_DO_COW(S2SMI(inode->i_sb)) &&
             (flags & SM_DO_COW)) {
+                struct snap_inode_info *sni_info = I2SNAPI(inode);
+                struct fsfilt_operations *snapops = I2SNAPOPS(inode);
+                
                 sni_info->sn_flags = flags;
                 vallen = sizeof(sni_info->sn_gen);