diff options
73 files changed, 773 insertions, 1080 deletions
diff --git a/Documentation/filesystems/sharedsubtree.txt b/Documentation/filesystems/sharedsubtree.txt index 23a181074f94..fc0e39af43c3 100644 --- a/Documentation/filesystems/sharedsubtree.txt +++ b/Documentation/filesystems/sharedsubtree.txt | |||
| @@ -837,6 +837,9 @@ replicas continue to be exactly same. | |||
| 837 | individual lists does not affect propagation or the way propagation | 837 | individual lists does not affect propagation or the way propagation |
| 838 | tree is modified by operations. | 838 | tree is modified by operations. |
| 839 | 839 | ||
| 840 | All vfsmounts in a peer group have the same ->mnt_master. If it is | ||
| 841 | non-NULL, they form a contiguous (ordered) segment of slave list. | ||
| 842 | |||
| 840 | A example propagation tree looks as shown in the figure below. | 843 | A example propagation tree looks as shown in the figure below. |
| 841 | [ NOTE: Though it looks like a forest, if we consider all the shared | 844 | [ NOTE: Though it looks like a forest, if we consider all the shared |
| 842 | mounts as a conceptual entity called 'pnode', it becomes a tree] | 845 | mounts as a conceptual entity called 'pnode', it becomes a tree] |
| @@ -874,8 +877,19 @@ replicas continue to be exactly same. | |||
| 874 | 877 | ||
| 875 | NOTE: The propagation tree is orthogonal to the mount tree. | 878 | NOTE: The propagation tree is orthogonal to the mount tree. |
| 876 | 879 | ||
| 880 | 8B Locking: | ||
| 881 | |||
| 882 | ->mnt_share, ->mnt_slave, ->mnt_slave_list, ->mnt_master are protected | ||
| 883 | by namespace_sem (exclusive for modifications, shared for reading). | ||
| 884 | |||
| 885 | Normally we have ->mnt_flags modifications serialized by vfsmount_lock. | ||
| 886 | There are two exceptions: do_add_mount() and clone_mnt(). | ||
| 887 | The former modifies a vfsmount that has not been visible in any shared | ||
| 888 | data structures yet. | ||
| 889 | The latter holds namespace_sem and the only references to vfsmount | ||
| 890 | are in lists that can't be traversed without namespace_sem. | ||
| 877 | 891 | ||
| 878 | 8B Algorithm: | 892 | 8C Algorithm: |
| 879 | 893 | ||
| 880 | The crux of the implementation resides in rbind/move operation. | 894 | The crux of the implementation resides in rbind/move operation. |
| 881 | 895 | ||
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index 341aff2687a5..cd128b07beda 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c | |||
| @@ -288,46 +288,30 @@ static int hypfs_fill_super(struct super_block *sb, void *data, int silent) | |||
| 288 | sb->s_blocksize_bits = PAGE_CACHE_SHIFT; | 288 | sb->s_blocksize_bits = PAGE_CACHE_SHIFT; |
| 289 | sb->s_magic = HYPFS_MAGIC; | 289 | sb->s_magic = HYPFS_MAGIC; |
| 290 | sb->s_op = &hypfs_s_ops; | 290 | sb->s_op = &hypfs_s_ops; |
| 291 | if (hypfs_parse_options(data, sb)) { | 291 | if (hypfs_parse_options(data, sb)) |
| 292 | rc = -EINVAL; | 292 | return -EINVAL; |
| 293 | goto err_alloc; | ||
| 294 | } | ||
| 295 | root_inode = hypfs_make_inode(sb, S_IFDIR | 0755); | 293 | root_inode = hypfs_make_inode(sb, S_IFDIR | 0755); |
| 296 | if (!root_inode) { | 294 | if (!root_inode) |
| 297 | rc = -ENOMEM; | 295 | return -ENOMEM; |
| 298 | goto err_alloc; | ||
| 299 | } | ||
| 300 | root_inode->i_op = &simple_dir_inode_operations; | 296 | root_inode->i_op = &simple_dir_inode_operations; |
| 301 | root_inode->i_fop = &simple_dir_operations; | 297 | root_inode->i_fop = &simple_dir_operations; |
| 302 | root_dentry = d_alloc_root(root_inode); | 298 | sb->s_root = root_dentry = d_alloc_root(root_inode); |
| 303 | if (!root_dentry) { | 299 | if (!root_dentry) { |
| 304 | iput(root_inode); | 300 | iput(root_inode); |
| 305 | rc = -ENOMEM; | 301 | return -ENOMEM; |
| 306 | goto err_alloc; | ||
| 307 | } | 302 | } |
| 308 | if (MACHINE_IS_VM) | 303 | if (MACHINE_IS_VM) |
| 309 | rc = hypfs_vm_create_files(sb, root_dentry); | 304 | rc = hypfs_vm_create_files(sb, root_dentry); |
| 310 | else | 305 | else |
| 311 | rc = hypfs_diag_create_files(sb, root_dentry); | 306 | rc = hypfs_diag_create_files(sb, root_dentry); |
| 312 | if (rc) | 307 | if (rc) |
| 313 | goto err_tree; | 308 | return rc; |
| 314 | sbi->update_file = hypfs_create_update_file(sb, root_dentry); | 309 | sbi->update_file = hypfs_create_update_file(sb, root_dentry); |
| 315 | if (IS_ERR(sbi->update_file)) { | 310 | if (IS_ERR(sbi->update_file)) |
| 316 | rc = PTR_ERR(sbi->update_file); | 311 | return PTR_ERR(sbi->update_file); |
| 317 | goto err_tree; | ||
| 318 | } | ||
