public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb•auug.org.au>
To: "Eric W. Biederman" <ebiederm@xmission•com>,
	Chris Mason <clm@fb•com>, Josef Bacik <jbacik@fb•com>
Cc: linux-next@vger•kernel.org, linux-kernel@vger•kernel.org,
	David Sterba <dsterba@suse•cz>
Subject: linux-next: manual merge of the userns tree with the btrfs tree
Date: Thu, 5 Jun 2014 17:28:24 +1000	[thread overview]
Message-ID: <20140605172824.31ecb811@canb.auug.org.au> (raw)

[-- 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 --]

                 reply	other threads:[~2014-06-05  7:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140605172824.31ecb811@canb.auug.org.au \
    --to=sfr@canb$(echo .)auug.org.au \
    --cc=clm@fb$(echo .)com \
    --cc=dsterba@suse$(echo .)cz \
    --cc=ebiederm@xmission$(echo .)com \
    --cc=jbacik@fb$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox