Browse Source

hfs: don't allow mounting over .../rsrc

That's one case when unlink() destroys a subtree, thanks to "resource
fork" idiocy.  We might forcibly evict that shit on unlink(2), but
for now let's just disallow overmounting; as it is, anything that
plays games with those would leak mounts.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Al Viro 7 years ago
parent
commit
0e5c56fd07
1 changed files with 1 additions and 0 deletions
  1. 1 0
      fs/hfs/inode.c

+ 1 - 0
fs/hfs/inode.c

@@ -543,6 +543,7 @@ static struct dentry *hfs_file_lookup(struct inode *dir, struct dentry *dentry,
 	igrab(dir);
 	igrab(dir);
 	hlist_add_fake(&inode->i_hash);
 	hlist_add_fake(&inode->i_hash);
 	mark_inode_dirty(inode);
 	mark_inode_dirty(inode);
+	dont_mount(dentry);
 out:
 out:
 	return d_splice_alias(inode, dentry);
 	return d_splice_alias(inode, dentry);
 }
 }