Re: [PATCH 1/3] jffs2: avoid unnecessarily taking f->sem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 27, 2018 at 12:38 PM Helmut Grohne <h.grohne@xxxxxxxxxx> wrote:
>
> jffs2_xattr_do_crccheck_inode creates a temporary struct
> jffs2_inode_info for handling it to jffs2_do_read_inode_internal.
> Formerly, jffs2_do_read_inode_internal released f->sem in the error path
> and that was why it had to be initialized, taken and released. As part
> of 7aaea7605c0 ("jffs2: fix unbalanced locking") locking was moved out
> of it.
>
> In the relevant jffs2_xattr_do_crccheck_inode we own the only reference
> to f as we allocate it with kmalloc. Since nothing else has knowledge of
> it, there is no need to lock it. In particular, that saves us from
> thinking about the correct locking class.
>
> We still need to initialize the mutex as jffs2_do_clear_inode insists on
> acquiring it.
>
> Signed-off-by: Helmut Grohne <h.grohne@xxxxxxxxxx>
> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>

Reviewed-by: Richard Weinberger <richard@xxxxxx>

-- 
Thanks,
//richard

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux