linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Btrfs: skip readonly root for snapshot-aware defragment
@ 2014-02-08 15:46 Wang Shilong
  2014-02-08 15:46 ` [RFC PATCH 2/2] Revert "Btrfs: remove transaction from btrfs send" Wang Shilong
  0 siblings, 1 reply; 6+ messages in thread
From: Wang Shilong @ 2014-02-08 15:46 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Wang Shilong

From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>

Btrfs send is assuming readonly root won't change, let's skip readonly root.

Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
---
 fs/btrfs/inode.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 1af34d0..e8dfd83 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -2239,6 +2239,11 @@ static noinline int relink_extent_backref(struct btrfs_path *path,
 		return PTR_ERR(root);
 	}
 
+	if (btrfs_root_readonly(root)) {
+		srcu_read_unlock(&fs_info->subvol_srcu, index);
+		return 0;
+	}
+
 	/* step 2: get inode */
 	key.objectid = backref->inum;
 	key.type = BTRFS_INODE_ITEM_KEY;
-- 
1.8.4


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

end of thread, other threads:[~2014-02-10 15:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-08 15:46 [PATCH 1/2] Btrfs: skip readonly root for snapshot-aware defragment Wang Shilong
2014-02-08 15:46 ` [RFC PATCH 2/2] Revert "Btrfs: remove transaction from btrfs send" Wang Shilong
2014-02-09  2:39   ` Shilong Wang
2014-02-09 13:52     ` Filipe David Manana
2014-02-09 14:20       ` Shilong Wang
2014-02-10 15:41   ` Josef Bacik

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).