Re: [PATCH 2/2] Btrfs: fix deadlock on sb->s_umount when doing umount

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

 



> +void btrfs_writeback_inodes_sb_nr(struct btrfs_root *root,
> +				  unsigned long nr_pages)
> +{
> +	struct super_block *sb = root->fs_info->sb;
> +
> +	if (writeback_in_progress(sb->s_bdi))
> +		return;
> +
> +	/*
> +	 * If we can not get s_umount, it means the fs is on remounting or
> +	 * umounting. At this time, we just sync all the delalloc file.
> +	 */
> +	if (down_read_trylock(&sb->s_umount)) {
> +		writeback_inodes_sb_nr(sb, nr_pages);
> +		up_read(&sb->s_umount);
> +	} else {
> +		btrfs_start_delalloc_inodes(root, 0);
> +		btrfs_wait_ordered_extents(root, 0, 0);
> +	}
> +}

If that can race with umount, what prevents sb, its ->s_bdi et.al. being freed
under you?
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux