ceph: no .snap inside of snapped namespace
authorSage Weil <sage@newdream.net>
Thu, 3 Mar 2011 21:44:35 +0000 (13:44 -0800)
committerSage Weil <sage@newdream.net>
Fri, 4 Mar 2011 20:25:09 +0000 (12:25 -0800)
Otherwise you can do things like

# mkdir .snap/foo
# cd .snap/foo/.snap
# ls
<badness>

Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/dir.c

index 196fd4c62db71183a1ba83fe4600e8fb107dadec..099a58615b90f73e29368ffba4793e5a17cb66ae 100644 (file)
@@ -496,6 +496,7 @@ struct dentry *ceph_finish_lookup(struct ceph_mds_request *req,
 
        /* .snap dir? */
        if (err == -ENOENT &&
+           ceph_snap(parent) == CEPH_NOSNAP &&
            strcmp(dentry->d_name.name,
                   fsc->mount_options->snapdir_name) == 0) {
                struct inode *inode = ceph_get_snapdir(parent);