[Ocfs2-devel] [PATCH] ocfs2: lock the page in __ocfs2_page_mkwrite() -v2
Joel Becker
Joel.Becker at oracle.com
Thu Dec 30 15:32:19 PST 2010
On Thu, Dec 16, 2010 at 08:56:06PM +0800, Wengang Wang wrote:
> In ocfs2_grab_pages_for_write() code, there is a comment that
>
> 1131 if (index == target_index && mmap_page) {
> 1132 /*
> 1133 * ocfs2_pagemkwrite() is a little different
> 1134 * and wants us to directly use the page
> 1135 * passed in.
> 1136 */
> 1137 lock_page(mmap_page);
>
> I guess it's commented by you? So how it "wants" us to use the page
> passed in?
> The main purpose of page_mkwrite() is to setup the mapping of page index to
> sector(block) numbers on the device. I don't see using the page passed in is
> very important. Correct me if I am wrong.
> So also for (index == target_index && mmap_page) situation, we can use
> find_or_create_page() just like where it's used in other situation.
> find_lock_page() takes care of (page->mapping != mapping). How about it?
Boy, this is a rabbit hole. The return codes for page_mkwrite()
got changed a year ago, and no one updated ocfs2 (or ext4 or gfs2 for
that matter). I've emailed Nick about it.
Joel
--
"Senator let's be sincere,
As much as you can."
Joel Becker
Senior Development Manager
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
More information about the Ocfs2-devel
mailing list