On Mon, Feb 11, 2019 at 10:22:45AM -0500, Brian Foster wrote: > It's an assert in xfs_bmapi_convert_delalloc() FWIW. That also doesn't > account for the fact that this changes an explicit error into a debug > mode notification. I'm not familiar with the history of this check and > the whole xfs_alert_fsblock_zero() thing, but AFAICT it's the only thing > that prevents an in-core record corruption from constructing a > superblock overwrite in this path. Ok, I'll change the earlier patch to return an error. > Can we please fix this comment to explain what "what the caller expects" > means? This could be as simple as appending "(i.e., the caller has > already trimmed against overlapping COW fork blocks)" to the last > sentence above. Actually, I think the better idea is to just do the explicit trim to cow_fsb in the caller, as that is a lot more obvious. > > + ASSERT(wpc->imap.br_startoff <= offset_fsb); > > + ASSERT(wpc->imap.br_startoff + wpc->imap.br_blockcount >= offset_fsb); > > Looks like this one should be >. Indeed.