Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0f2cc4ec authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (52 commits)
  init: Open /dev/console from rootfs
  mqueue: fix typo "failues" -> "failures"
  mqueue: only set error codes if they are really necessary
  mqueue: simplify do_open() error handling
  mqueue: apply mathematics distributivity on mq_bytes calculation
  mqueue: remove unneeded info->messages initialization
  mqueue: fix mq_open() file descriptor leak on user-space processes
  fix race in d_splice_alias()
  set S_DEAD on unlink() and non-directory rename() victims
  vfs: add NOFOLLOW flag to umount(2)
  get rid of ->mnt_parent in tomoyo/realpath
  hppfs can use existing proc_mnt, no need for do_kern_mount() in there
  Mirror MS_KERNMOUNT in ->mnt_flags
  get rid of useless vfsmount_lock use in put_mnt_ns()
  Take vfsmount_lock to fs/internal.h
  get rid of insanity with namespace roots in tomoyo
  take check for new events in namespace (guts of mounts_poll()) to namespace.c
  Don't mess with generic_permission() under ->d_lock in hpfs
  sanitize const/signedness for udf
  nilfs: sanitize const/signedness in dealing with ->d_name.name
  ...

Fix up fairly trivial (famous last words...) conflicts in
drivers/infiniband/core/uverbs_main.c and security/tomoyo/realpath.c
parents 1fae4cfb 9643f5d9
Loading
Loading
Loading
Loading
+15 −1
Original line number Original line Diff line number Diff line
@@ -837,6 +837,9 @@ replicas continue to be exactly same.
	 individual lists does not affect propagation or the way propagation
	 individual lists does not affect propagation or the way propagation
	 tree is modified by operations.
	 tree is modified by operations.


	All vfsmounts in a peer group have the same ->mnt_master.  If it is
	non-NULL, they form a contiguous (ordered) segment of slave list.

	A example propagation tree looks as shown in the figure below.
	A example propagation tree looks as shown in the figure below.
	[ NOTE: Though it looks like a forest, if we consider all the shared
	[ NOTE: Though it looks like a forest, if we consider all the shared
	mounts as a conceptual entity called 'pnode', it becomes a tree]
	mounts as a conceptual entity called 'pnode', it becomes a tree]
@@ -874,8 +877,19 @@ replicas continue to be exactly same.


	NOTE: The propagation tree is orthogonal to the mount tree.
	NOTE: The propagation tree is orthogonal to the mount tree.


8B Locking:

	->mnt_share, ->mnt_slave, ->mnt_slave_list, ->mnt_master are protected
	by namespace_sem (exclusive for modifications, shared for reading).

	Normally we have ->mnt_flags modifications serialized by vfsmount_lock.
	There are two exceptions: do_add_mount() and clone_mnt().
	The former modifies a vfsmount that has not been visible in any shared
	data structures yet.
	The latter holds namespace_sem and the only references to vfsmount
	are in lists that can't be traversed without namespace_sem.


8B Algorithm:
8C Algorithm:


	The crux of the implementation resides in rbind/move operation.
	The crux of the implementation resides in rbind/move operation.


+13 −29
Original line number Original line Diff line number Diff line
@@ -288,46 +288,30 @@ static int hypfs_fill_super(struct super_block *sb, void *data, int silent)
	sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
	sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
	sb->s_magic = HYPFS_MAGIC;
	sb->s_magic = HYPFS_MAGIC;
	sb->s_op = &hypfs_s_ops;
	sb->s_op = &hypfs_s_ops;
	if (hypfs_parse_options(data, sb)) {
	if (hypfs_parse_options(data, sb))
		rc = -EINVAL;
		return -EINVAL;
		goto err_alloc;
	}
	root_inode = hypfs_make_inode(sb, S_IFDIR | 0755);
	root_inode = hypfs_make_inode(sb, S_IFDIR | 0755);
	if (!root_inode) {
	if (!root_inode)
		rc = -ENOMEM;
		return -ENOMEM;
		goto err_alloc;
	}
	root_inode->i_op = &simple_dir_inode_operations;
	root_inode->i_op = &simple_dir_inode_operations;
	root_inode->i_fop = &simple_dir_operations;
	root_inode->i_fop = &simple_dir_operations;
	root_dentry = d_alloc_root(root_inode);
	sb->s_root = root_dentry = d_alloc_root(root_inode);
	if (!root_dentry) {
	if (!root_dentry) {
		iput(root_inode);
		iput(root_inode);
		rc = -ENOMEM;
		return -ENOMEM;
		goto err_alloc;
	}
	}
	if (MACHINE_IS_VM)
	if (MACHINE_IS_VM)
		rc = hypfs_vm_create_files(sb, root_dentry);
		rc = hypfs_vm_create_files(sb, root_dentry);
	else
	else
		rc = hypfs_diag_create_files(sb, root_dentry);
		rc = hypfs_diag_create_files(sb, root_dentry);
	if (rc)
	if (rc)
		goto err_tree;
		return rc;
	sbi->update_file = hypfs_create_update_file(sb, root_dentry);
	sbi->update_file = hypfs_create_update_file(sb, root_dentry);
	if (IS_ERR(sbi->update_file)) {
	if (IS_ERR(sbi->update_file))
		rc = PTR_ERR(sbi->update_file);
		return PTR_ERR(sbi->update_file);
		goto err_tree;
	}
	hypfs_update_update(sb);
	hypfs_update_update(sb);
	sb->s_root = root_dentry;
	pr_info("Hypervisor filesystem mounted\n");
	pr_info("Hypervisor filesystem mounted\n");
	return 0;
	return 0;

err_tree:
	hypfs_delete_tree(root_dentry);
	d_genocide(root_dentry);
	dput(root_dentry);
err_alloc:
	kfree(sbi);
	return rc;
}
}


static int hypfs_get_super(struct file_system_type *fst, int flags,
static int hypfs_get_super(struct file_system_type *fst, int flags,
@@ -340,12 +324,12 @@ static void hypfs_kill_super(struct super_block *sb)
{
{
	struct hypfs_sb_info *sb_info = sb->s_fs_info;
	struct hypfs_sb_info *sb_info = sb->s_fs_info;


	if (sb->s_root) {
	if (sb->s_root)
		hypfs_delete_tree(sb->s_root);
		hypfs_delete_tree(sb->s_root);
	if (sb_info->update_file)
		hypfs_remove(sb_info->update_file);
		hypfs_remove(sb_info->update_file);
	kfree(sb->s_fs_info);
	kfree(sb->s_fs_info);
	sb->s_fs_info = NULL;
	sb->s_fs_info = NULL;
	}
	kill_litter_super(sb);
	kill_litter_super(sb);
}
}


+1 −1
Original line number Original line Diff line number Diff line
@@ -140,7 +140,7 @@ void mconsole_proc(struct mc_request *req)
		goto out;
		goto out;
	}
	}


	err = may_open(&nd.path, MAY_READ, FMODE_READ);
	err = may_open(&nd.path, MAY_READ, O_RDONLY);
	if (result) {
	if (result) {
		mconsole_reply(req, "Failed to open file", 1, 0);
		mconsole_reply(req, "Failed to open file", 1, 0);
		path_put(&nd.path);
		path_put(&nd.path);
+1 −1
Original line number Original line Diff line number Diff line
@@ -146,7 +146,7 @@ extern struct idr ib_uverbs_srq_idr;
void idr_remove_uobj(struct idr *idp, struct ib_uobject *uobj);
void idr_remove_uobj(struct idr *idp, struct ib_uobject *uobj);


struct file *ib_uverbs_alloc_event_file(struct ib_uverbs_file *uverbs_file,
struct file *ib_uverbs_alloc_event_file(struct ib_uverbs_file *uverbs_file,
					int is_async, int *fd);
					int is_async);
struct ib_uverbs_event_file *ib_uverbs_lookup_comp_file(int fd);
struct ib_uverbs_event_file *ib_uverbs_lookup_comp_file(int fd);


void ib_uverbs_release_ucq(struct ib_uverbs_file *file,
void ib_uverbs_release_ucq(struct ib_uverbs_file *file,
+20 −5
Original line number Original line Diff line number Diff line
@@ -301,10 +301,15 @@ ssize_t ib_uverbs_get_context(struct ib_uverbs_file *file,


	resp.num_comp_vectors = file->device->num_comp_vectors;
	resp.num_comp_vectors = file->device->num_comp_vectors;


	filp = ib_uverbs_alloc_event_file(file, 1, &resp.async_fd);
	ret = get_unused_fd();
	if (ret < 0)
		goto err_free;
	resp.async_fd = ret;

	filp = ib_uverbs_alloc_event_file(file, 1);
	if (IS_ERR(filp)) {
	if (IS_ERR(filp)) {
		ret = PTR_ERR(filp);
		ret = PTR_ERR(filp);
		goto err_free;
		goto err_fd;
	}
	}


	if (copy_to_user((void __user *) (unsigned long) cmd.response,
	if (copy_to_user((void __user *) (unsigned long) cmd.response,
@@ -332,9 +337,11 @@ ssize_t ib_uverbs_get_context(struct ib_uverbs_file *file,
	return in_len;
	return in_len;


err_file:
err_file:
	put_unused_fd(resp.async_fd);
	fput(filp);
	fput(filp);


err_fd:
	put_unused_fd(resp.async_fd);

err_free:
err_free:
	ibdev->dealloc_ucontext(ucontext);
	ibdev->dealloc_ucontext(ucontext);


@@ -715,6 +722,7 @@ ssize_t ib_uverbs_create_comp_channel(struct ib_uverbs_file *file,
	struct ib_uverbs_create_comp_channel	   cmd;
	struct ib_uverbs_create_comp_channel	   cmd;
	struct ib_uverbs_create_comp_channel_resp  resp;
	struct ib_uverbs_create_comp_channel_resp  resp;
	struct file				  *filp;
	struct file				  *filp;
	int ret;


	if (out_len < sizeof resp)
	if (out_len < sizeof resp)
		return -ENOSPC;
		return -ENOSPC;
@@ -722,9 +730,16 @@ ssize_t ib_uverbs_create_comp_channel(struct ib_uverbs_file *file,
	if (copy_from_user(&cmd, buf, sizeof cmd))
	if (copy_from_user(&cmd, buf, sizeof cmd))
		return -EFAULT;
		return -EFAULT;


	filp = ib_uverbs_alloc_event_file(file, 0, &resp.fd);
	ret = get_unused_fd();
	if (IS_ERR(filp))
	if (ret < 0)
		return ret;
	resp.fd = ret;

	filp = ib_uverbs_alloc_event_file(file, 0);
	if (IS_ERR(filp)) {
		put_unused_fd(resp.fd);
		return PTR_ERR(filp);
		return PTR_ERR(filp);
	}


	if (copy_to_user((void __user *) (unsigned long) cmd.response,
	if (copy_to_user((void __user *) (unsigned long) cmd.response,
			 &resp, sizeof resp)) {
			 &resp, sizeof resp)) {
Loading