Skip to contentSkip to conversation

prepare_write problem for small write when page not uptodate

DISCUSSION Steve French 1 participant 2 messages Apr 29, 2004 VFS

lore
Share & tools
lore
#0 lore raw
Quoted 2 lines

Seems like invalidate_remote_inode (eventually calling invalidate_complete_page) does not always actually free the page

Switching from invalidate_remote_inode (invalidate_mapping_pages) to invalidate_inode_pages2 in cifs worked and fixed the problem (partial page write corrupts a page that is marked not uptodate due to invalidate_remote_inode). Still not clear to me when you would use truncate_inode_pages and when you would use invalidate_inode_pages2.

#1 lore raw
Quoted 8 lines · Steve French
Quoted 2 lines

Seems like invalidate_remote_inode (eventually calling invalidate_complete_page) does not always actually free the page

Switching from invalidate_remote_inode (invalidate_mapping_pages) to invalidate_inode_pages2 in cifs worked and fixed the problem (partial page write corrupts a page that is marked not uptodate due to invalidate_remote_inode). Still not clear to me when you would use truncate_inode_pages and when you would use invalidate_inode_pages2.

False alarm - none of the three worked.

Looks like I am going to have to fall back to the hard way - in prepare_write if page is not up to date - read it from the server since I can't seem to force the mm code to do a readpage first by tossing the page via any of the three mechanisms.