lkml.org 
[lkml]   [2005]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 5/9] mm: uml pte atomicity
    There's usually a good reason when a pte is examined without the lock;
    but it makes me nervous when the pointer is dereferenced more than once.

    Signed-off-by: Hugh Dickins <hugh@veritas.com>
    ---

    arch/um/kernel/process_kern.c | 8 +++++---
    1 files changed, 5 insertions(+), 3 deletions(-)

    --- mm4/arch/um/kernel/process_kern.c 2005-10-17 12:05:14.000000000 +0100
    +++ mm5/arch/um/kernel/process_kern.c 2005-10-22 14:06:58.000000000 +0100
    @@ -222,6 +222,7 @@ void *um_virt_to_phys(struct task_struct
    pud_t *pud;
    pmd_t *pmd;
    pte_t *pte;
    + pte_t ptent;

    if(task->mm == NULL)
    return(ERR_PTR(-EINVAL));
    @@ -238,12 +239,13 @@ void *um_virt_to_phys(struct task_struct
    return(ERR_PTR(-EINVAL));

    pte = pte_offset_kernel(pmd, addr);
    - if(!pte_present(*pte))
    + ptent = *pte;
    + if(!pte_present(ptent))
    return(ERR_PTR(-EINVAL));

    if(pte_out != NULL)
    - *pte_out = *pte;
    - return((void *) (pte_val(*pte) & PAGE_MASK) + (addr & ~PAGE_MASK));
    + *pte_out = ptent;
    + return((void *) (pte_val(ptent) & PAGE_MASK) + (addr & ~PAGE_MASK));
    }

    char *current_cmd(void)
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2005-10-22 18:29    [W:0.021 / U:159.568 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site