All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the userns tree with the btrfs tree
@ 2014-06-05  7:28 Stephen Rothwell
  0 siblings, 0 replies; only message in thread
From: Stephen Rothwell @ 2014-06-05  7:28 UTC (permalink / raw)
  To: Eric W. Biederman, Chris Mason, Josef Bacik
  Cc: linux-next, linux-kernel, David Sterba

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

Hi Eric,

Today's linux-next merge of the userns tree got a conflict in
fs/btrfs/ioctl.c between commit e4e7602f3304 ("btrfs: protect snapshots
from deleting during send") from the btrfs tree and commit 23135a9bd700
("vfs: Make d_invalidate return void") from the userns tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).  Thanks, Chris for the resolution.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc fs/btrfs/ioctl.c
index 99431aa5371f,349848bd54e2..000000000000
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@@ -2334,30 -2229,7 +2334,28 @@@ static noinline int btrfs_ioctl_snap_de
  	}
  
  	mutex_lock(&inode->i_mutex);
 +
 +	/*
 +	 * Don't allow to delete a subvolume with send in progress. This is
 +	 * inside the i_mutex so the error handling that has to drop the bit
 +	 * again is not run concurrently.
 +	 */
 +	spin_lock(&dest->root_item_lock);
 +	root_flags = btrfs_root_flags(&dest->root_item);
 +	if (dest->send_in_progress == 0) {
 +		btrfs_set_root_flags(&dest->root_item,
 +				root_flags | BTRFS_ROOT_SUBVOL_DEAD);
 +		spin_unlock(&dest->root_item_lock);
 +	} else {
 +		spin_unlock(&dest->root_item_lock);
 +		btrfs_warn(root->fs_info,
 +			"Attempt to delete subvolume %llu during send",
 +			dest->root_key.objectid);
 +		err = -EPERM;
 +		goto out_dput;
 +	}
 +
- 	err = d_invalidate(dentry);
- 	if (err)
- 		goto out_unlock;
+ 	d_invalidate(dentry);
  
  	down_write(&root->fs_info->subvol_sem);
  
@@@ -2442,14 -2314,6 +2440,14 @@@ out_release
  	btrfs_subvolume_release_metadata(root, &block_rsv, qgroup_reserved);
  out_up_write:
  	up_write(&root->fs_info->subvol_sem);
- out_unlock:
++
 +	if (err) {
 +		spin_lock(&dest->root_item_lock);
 +		root_flags = btrfs_root_flags(&dest->root_item);
 +		btrfs_set_root_flags(&dest->root_item,
 +				root_flags & ~BTRFS_ROOT_SUBVOL_DEAD);
 +		spin_unlock(&dest->root_item_lock);
 +	}
  	mutex_unlock(&inode->i_mutex);
  	if (!err) {
  		shrink_dcache_sb(root->fs_info->sb);

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-06-05  7:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-05  7:28 linux-next: manual merge of the userns tree with the btrfs tree Stephen Rothwell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.