On Sat, Oct 22 2016, Song Liu wrote: >>> + /* stripes only have parity are already flushed to RAID */ >>> + if (data_count == 0) >>> + goto out; >> >> Can you explain why that is? When were they flushed to the RAID, and >> how was the parity determined? > > It happens like this: say two stripes on journal: 100 and 200. The data (D) > and parity (P) pages are store in journal as: > > ---> D100 D200 P100 P200 ----> newer data > > Before we flush D100, journal_start points as D100. Then we flush D100, > and new journal_start points as D200. Now the system fails, so next > recovery starts from D200. Recovery code will find stripe 100 only has > parity. This means, stripe 100 is already flushed to raid. so we can ignore it. OK, I see. Thanks. So the data for the stripe had previously been flushed before the crash that is currently being recovered from. It might help to make the time of the flush more explicit in the comment: /* stripes that only have parity must have been flushed * before the crash that we are now recovering from, so * there is nothing more to recovery. */ Something like that. Thanks, NeilBrown
Attachment:
signature.asc
Description: PGP signature