Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  • Manjong Lee's avatar
    mm: bdi: initialize bdi_min_ratio when bdi is unregistered · 3c376dfa
    Manjong Lee authored
    Initialize min_ratio if it is set during bdi unregistration.  This can
    prevent problems that may occur a when bdi is removed without resetting
    min_ratio.
    
    For example.
    1) insert external sdcard
    2) set external sdcard's min_ratio 70
    3) remove external sdcard without setting min_ratio 0
    4) insert external sdcard
    5) set external sdcard's min_ratio 70 << error occur(can't set)
    
    Because when an sdcard is removed, the present bdi_min_ratio value will
    remain.  Currently, the only way to reset bdi_min_ratio is to reboot.
    
    [akpm@linux-foundation.org: tweak comment and coding style]
    
    Link: https://lkml.kernel.org/r/20211021161942.5983-1-mj0123.lee@samsung.com
    
    
    Signed-off-by: default avatarManjong Lee <mj0123.lee@samsung.com>
    Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
    Cc: Changheun Lee <nanich.lee@samsung.com>
    Cc: Jens Axboe <axboe@kernel.dk>
    Cc: Christoph Hellwig <hch@infradead.org>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: <seunghwan.hyun@samsung.com>
    Cc:...
    3c376dfa