On Monday, December 19, 2016 02:56:41 PM Qu Wenruo wrote: > Since we have the whole facilities needed to rollback, switch to the new > rollback. > > The new rollback function can handle the following things that old > rollback either can't handle or just refuse to rollback: > > 1) New converted btrfs which allocates new data chunk > This is due to the too restrict may_roll_back() condition, which is > never a good friend for new convert behavior. > > The new rollback behavior fixes it by not checking data chunks, but > only to check the file extents of the convert image file. > > If all file extents except the ones in reserved ranges, then we allow > rollback. > > 2) New converted btrfs which enabled NO_HOLES feature > Thanks to previous patches, we can convert to real NO_HOLES btrfs. > > And since old rollback assumes that file extents and holes covers the > whole image file, it will fail due to the non-exists holes. > > Fix it by iterating file extents of convert image, and only compare > the size we checked against file size if NO_HOLES is not enabled. > > And makes rollback function simpler: > > 1) Read-n-write vs extra chunk tree relocation > Since converted btrfs only has 3 ranges that are not 1:1 mapped, just > read this data out, and close btrfs, finally write them into position > will be good enough, for both new convert and old convert. > (To be more specific, old convert is just a subset of more universal > new convert behavior) > > No extra work is needed any more, and we can even open the btrfs RO.
Thanks for fixing this. The patchset works fine on ppc64 and x86_64. Tested-by: Chandan Rajendra <chan...@linux.vnet.ibm.com> -- chandan -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html