diff --git a/[refs] b/[refs] index c50eb09c4eab..0d87775be49d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4ed1d16e944c61cfb8a78159548672e7df168d97 +refs/heads/master: e5df957328b18baa731307c66cfe8e7a4981df65 diff --git a/trunk/fs/btrfs/ctree.c b/trunk/fs/btrfs/ctree.c index e2e43c07f6b1..3b767d2b68e8 100644 --- a/trunk/fs/btrfs/ctree.c +++ b/trunk/fs/btrfs/ctree.c @@ -333,7 +333,11 @@ static noinline int update_ref_for_cow(struct btrfs_trans_handle *trans, buf->len, &refs, &flags); if (ret) return ret; - BUG_ON(refs == 0); + if (refs == 0) { + ret = -EROFS; + btrfs_std_error(root->fs_info, ret); + return ret; + } } else { refs = 1; if (root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID ||