On Mon, Feb 20, 2017 at 5:08 PM, Goldwyn Rodrigues <rgold...@suse.de> wrote: > Hi, > > Why do we call btrfs_run_delayed_refs multiple times in a function? Some > of the examples are: > > btrfs_commit_transaction() > commit_cowonly_roots() > > Is it because one call can generate more delayed refs and hence we need > to run them again? Under what scenarios is this possible?
All extents, for both data and metadata, are reference counted and have back references in the extent tree. Adding/updating/removing things to/in/from a tree implies COWing metadata extents (tree nodes and leaves), which implies generating more delayed references. Eventually this loop stops, as metadata extents are COWed only once per transaction or more times if writeback was triggered. So it's possible in all scenarios. > > -- > Goldwyn > -- > 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 -- Filipe David Manana, "People will forget what you said, people will forget what you did, but people will never forget how you made them feel." -- 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