lkml.org 
[lkml]   [2011]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [RFC] block integrity: Fix write after checksum calculation problem
    Date
    Excerpts from Jeff Layton's message of 2011-04-11 12:42:29 -0400:
    > > @@ -5839,6 +5844,15 @@ int ext4_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
    > > if (ret < 0)
    > > goto out_unlock;
    > > ret = 0;
    > > +
    > > + /*
    > > + * write_begin/end might have created a dirty page and someone
    > > + * could wander in and start the IO. Make sure that hasn't
    > > + * happened.
    > > + */
    > > + lock_page(page);
    > > + wait_on_page_writeback(page);
    > > + unlock_page(page);
    >
    > nit:
    >
    > The callers of page_mkwrite always lock the page afterward if you
    > return from page_mkwrite with it unlocked. If you plan to take page
    > lock anyway, it's probably slightly more efficient not to unlock it and
    > instead return VM_FAULT_LOCKED.
    >

    Actually this isn't a nit. Keeping the page locked closes an important
    hole where it can become writeback again. It might fix the last
    remaining problem.

    -chris


    \
     
     \ /
      Last update: 2011-04-11 19:45    [W:2.783 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site