mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 15:18:19 +00:00
fs/ntfs3: fix deadlock in mark_as_free_ex
commit bfbe5b31ca
upstream.
Reported-by: syzbot+e94d98936a0ed08bde43@syzkaller.appspotmail.com
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ab40c7ab7a
commit
efe43d1bcb
1 changed files with 5 additions and 1 deletions
|
@ -2458,10 +2458,12 @@ void mark_as_free_ex(struct ntfs_sb_info *sbi, CLST lcn, CLST len, bool trim)
|
|||
{
|
||||
CLST end, i;
|
||||
struct wnd_bitmap *wnd = &sbi->used.bitmap;
|
||||
bool dirty = false;
|
||||
|
||||
down_write_nested(&wnd->rw_lock, BITMAP_MUTEX_CLUSTERS);
|
||||
if (!wnd_is_used(wnd, lcn, len)) {
|
||||
ntfs_set_state(sbi, NTFS_DIRTY_ERROR);
|
||||
/* mark volume as dirty out of wnd->rw_lock */
|
||||
dirty = true;
|
||||
|
||||
end = lcn + len;
|
||||
len = 0;
|
||||
|
@ -2493,6 +2495,8 @@ void mark_as_free_ex(struct ntfs_sb_info *sbi, CLST lcn, CLST len, bool trim)
|
|||
|
||||
out:
|
||||
up_write(&wnd->rw_lock);
|
||||
if (dirty)
|
||||
ntfs_set_state(sbi, NTFS_DIRTY_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue