On Sat, Sep 24, 2016 at 08:19:19AM -0700, Christoph Hellwig wrote: > I've got a bug report with a slightly older version of the reflink > code, in which I get a bogus NULL xfs_bmbt_rec_host pointer back from > xfs_iext_bno_to_ext in xfs_reflink_find_cow_mapping. I've not > reproduced that bug myself yet, but what's clear from the report is > that it's not just inefficient but also potentially dangerous to > do the blind dereference in xfs_reflink_find_cow_mapping after > we dropped the ilock from the previous xfs_reflink_find_cow_mapping > call. FYI, based on further analsys I suspect that a xfs_reflink_end_cow called from xfs_end_io cause the extent index to be invalid during the xfs_reflink_find_cow_mapping mapping, as that can easily shift the extent indices around and race with writeback elsewhere on the same file. -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html