elastio / elastio-snap

kernel module for taking block-level snapshots and incremental backups of Linux block devices
GNU General Public License v2.0
21 stars 6 forks source link

Accelerate cow file allocation #264

Closed skypodolsky closed 1 year ago

skypodolsky commented 1 year ago

Main changes:

Explanation on the last one: this covers the case when the module is removed in the dormant state. In such a case, the direct write to the COW file takes place to write the rest of bio requests which have not been processed yet. However, it may (and likely will) happen that the COW file extents, which are being used for the direct write, aren't initialized by the FS. Hence, if we simply write there, there's no chance this data will be available at the next volume mount. To make this possible, we write some data ahead to ensure the extent is valid during the direct write operation.

Closes #260

skypodolsky commented 1 year ago

So the tests have demonstrated that the amount of data that needs to be written cannot be estimated in cow_sync_and_close. Hence, I decided to write some predefined amount of data. I suppose that 4 MB should be enough for that.