linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the vfs tree with the btrfs-kdave tree
@ 2017-11-08 22:47 Stephen Rothwell
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2017-11-08 22:47 UTC (permalink / raw)
  To: Al Viro, David Sterba
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List,
	David Howells, Tomohiro Misono

Hi Al,

Today's linux-next merge of the vfs tree got a conflict in:

  fs/btrfs/super.c

between commit:

  c2a6acf1b800 ("btrfs: cleanup btrfs_mount() using mount_root()")

from the btrfs-kdave tree and commit:

  c2c6773f9942 ("VFS: Roll out mount flag differentiation (MS_* -> SB_*) generally")

from the vfs tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/super.c
index 254e7422a69e,e56a93f3113e..000000000000
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@@ -1530,9 -1543,11 +1530,9 @@@ static struct dentry *mount_root(struc
  	struct btrfs_fs_info *fs_info = NULL;
  	struct security_mnt_opts new_sec_opts;
  	fmode_t mode = FMODE_READ;
 -	char *subvol_name = NULL;
 -	u64 subvol_objectid = 0;
  	int error = 0;
  
- 	if (!(flags & MS_RDONLY))
+ 	if (!(flags & SB_RDONLY))
  		mode |= FMODE_WRITE;
  
  	error = btrfs_parse_early_options(data, mode, fs_type,
@@@ -1624,84 -1647,6 +1624,84 @@@ error_sec_opts
  	return ERR_PTR(error);
  }
  
 +/*
 + * Mount function which is called by VFS layer.
 + *
 + * In order to allow mounting a subvolume directly, btrfs uses
 + * mount_subtree() which needs vfsmount* of device's root (/).
 + * This means device's root has to be mounted internally in any case.
 + *
 + * Operation flow:
 + *   1. Parse subvol id related options for later use in mount_subvol().
 + *
 + *   2. Mount device's root (/) by calling vfs_kern_mount().
 + *
 + *      NOTE: vfs_kern_mount() is used by VFS to call btrfs_mount() in the
 + *      first place. In order to avoid calling btrfs_mount() again, we use
 + *      different file_system_type which is not registered to VFS by
 + *      register_filesystem(). As a result, mount_root() is called.
 + *      The return value will be used by mount_subtree() in mount_subvol().
 + *
 + *   3. Call mount_subvol() to get the dentry of subvolume. Since there is
 + *      "btrfs subvolume set-default", mount_subvol() is called always.
 + */
 +static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
 +		const char *device_name, void *data)
 +{
 +	struct vfsmount *mnt_root;
 +	struct dentry *root;
 +	fmode_t mode = FMODE_READ;
 +	char *subvol_name = NULL;
 +	u64 subvol_objectid = 0;
 +	int error = 0;
 +
- 	if (!(flags & MS_RDONLY))
++	if (!(flags & SB_RDONLY))
 +		mode |= FMODE_WRITE;
 +
 +	error = btrfs_parse_subvol_options(data, mode, fs_type,
 +					  &subvol_name, &subvol_objectid);
 +	if (error) {
 +		kfree(subvol_name);
 +		return ERR_PTR(error);
 +	}
 +
 +	/* mount device's root (/) */
 +	mnt_root = vfs_kern_mount(&btrfs_root_fs_type, flags, device_name, data);
 +	if (PTR_ERR_OR_ZERO(mnt_root) == -EBUSY) {
- 		if (flags & MS_RDONLY) {
- 			mnt_root = vfs_kern_mount(&btrfs_root_fs_type, flags & ~MS_RDONLY,
++		if (flags & SB_RDONLY) {
++			mnt_root = vfs_kern_mount(&btrfs_root_fs_type, flags & ~SB_RDONLY,
 +					     device_name, data);
 +		} else {
- 			mnt_root = vfs_kern_mount(&btrfs_root_fs_type, flags | MS_RDONLY,
++			mnt_root = vfs_kern_mount(&btrfs_root_fs_type, flags | SB_RDONLY,
 +					     device_name, data);
 +			if (IS_ERR(mnt_root)) {
 +				root = ERR_CAST(mnt_root);
 +				goto out;
 +			}
 +
 +			down_write(&mnt_root->mnt_sb->s_umount);
 +			error = btrfs_remount(mnt_root->mnt_sb, &flags, NULL);
 +			up_write(&mnt_root->mnt_sb->s_umount);
 +			if (error < 0) {
 +				root = ERR_PTR(error);
 +				mntput(mnt_root);
 +				goto out;
 +			}
 +		}
 +	}
 +	if (IS_ERR(mnt_root)) {
 +		root = ERR_CAST(mnt_root);
 +		goto out;
 +	}
 +
 +	/* mount_subvol() will free subvol_name and mnt_root */
 +	root = mount_subvol(subvol_name, subvol_objectid, flags,
 +				    device_name, data, mnt_root);
 +
 +out:
 +	return root;
 +}
 +
  static void btrfs_resize_thread_pool(struct btrfs_fs_info *fs_info,
  				     int new_pool_size, int old_pool_size)
  {

^ permalink raw reply	[flat|nested] 3+ messages in thread

* linux-next: manual merge of the vfs tree with the btrfs-kdave tree
@ 2018-08-02  0:31 Stephen Rothwell
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2018-08-02  0:31 UTC (permalink / raw)
  To: Al Viro, David Sterba; +Cc: Linux-Next Mailing List, Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 1239 bytes --]

Hi all,

Today's linux-next merge of the vfs tree got conflicts in:

  fs/btrfs/inode.c
  fs/btrfs/tree-log.c

Commits

  8e5d411c91c1 ("btrfs: simplify btrfs_iget()")
  cfac83868124 ("btrfs: lift make_bad_inode() into btrfs_iget()")
  efa119590db3 ("btrfs: IS_ERR(p) && PTR_ERR(p) == n is a weird way to spell p == ERR_PTR(n)")
  353dd669cc08 ("btrfs: btrfs_iget() never returns an is_bad_inode() inode.")

from the vfs tree are duplicated as commits

  5ee149473042 ("btrfs: simplify btrfs_iget")
  083a7dddaecc ("btrfs: lift make_bad_inode into btrfs_iget")
  8bca6b1de61e ("btrfs: simplify IS_ERR/PTR_ERR checks")
  7ffab8b69edc ("btrfs: btrfs_iget never returns an is_bad_inode inode")

in the btrfs-kdave tree :-( (except 5ee149473042 has an extra comment
and efa119590db3 has na extra space)

I fixed it up (the obvious way) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* linux-next: manual merge of the vfs tree with the btrfs-kdave tree
@ 2017-09-14  0:31 Stephen Rothwell
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2017-09-14  0:31 UTC (permalink / raw)
  To: Al Viro, David Sterba
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List,
	David Howells, Christos Gkekas

Hi Al,

Today's linux-next merge of the vfs tree got a conflict in:

  fs/btrfs/root-tree.c

between commit:

  8b591d54b74b ("btrfs: Clean up dead code in root-tree")

from the btrfs-kdave tree and commit:

  bc98a42c1f7d ("VFS: Convert sb->s_flags & MS_RDONLY to sb_rdonly(sb)")

from the vfs tree.

I fixed it up (the former removed the code updated by the latter, so I
did that) and can carry the fix as necessary. This is now fixed as far as
linux-next is concerned, but any non trivial conflicts should be mentioned
to your upstream maintainer when your tree is submitted for merging.
You may also want to consider cooperating with the maintainer of the
conflicting tree to minimise any particularly complex conflicts.

[David Sterba: just wondering if all the commits that appeared in the
btrfs-kdave tree today (so late in the merge window) are really destined
for v4.14?]

-- 
Cheers,
Stephen Rothwell

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-02  0:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-08 22:47 linux-next: manual merge of the vfs tree with the btrfs-kdave tree Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2018-08-02  0:31 Stephen Rothwell
2017-09-14  0:31 Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).