Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

logfs: initialize superblock entries earlier

In particular, s_freeing_list needs to be initialized early, since it is
used on some of the error paths when mounts fail. The mapping inode,
for example, would be initialized and then free'd on an error path
before s_freeing_list was initialized, but the inode drop operation
needs the s_freeing_list to be set up.

Normally you'd never see this, because not only is logfs fairly rare,
but a successful mount will never have any issues.

Reported-by: werner <w.landgraf@ru.ru>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+4 -4
+4 -4
fs/logfs/super.c
··· 480 480 !read_only) 481 481 return -EIO; 482 482 483 - mutex_init(&super->s_dirop_mutex); 484 - mutex_init(&super->s_object_alias_mutex); 485 - INIT_LIST_HEAD(&super->s_freeing_list); 486 - 487 483 ret = logfs_init_rw(sb); 488 484 if (ret) 489 485 return ret; ··· 596 600 super = kzalloc(sizeof(*super), GFP_KERNEL); 597 601 if (!super) 598 602 return ERR_PTR(-ENOMEM); 603 + 604 + mutex_init(&super->s_dirop_mutex); 605 + mutex_init(&super->s_object_alias_mutex); 606 + INIT_LIST_HEAD(&super->s_freeing_list); 599 607 600 608 if (!devname) 601 609 err = logfs_get_sb_bdev(super, type, devname);