datto / dattobd

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

Regarding the page_get_inode, thanks! #263

Open zhanghaiyang9999 opened 2 years ago

zhanghaiyang9999 commented 2 years ago

HI, I have a question to ask for help.

in function page_get_inode, will return the inode via pg->mapping->host If the file corresponds to the inode(pg->mapping->host) just been removed when calling the page_get_inode function, what's the result? the pg->mapping->host is null or other value? thanks!

dakotarwilliams commented 2 years ago

It going to depend on the page cache. If it's synchronized, then the mapping should be null. If for some reason, there's a race, then it should have the old inode value (which isn't great since we could miss recording that a write happened). In our case, this doesn't matter that much since we're only checking against the inode of our cow file, and if that disappears, the snapshot is no good anyway.