Return-Path: Received: from mx2.suse.de ([195.135.220.15]:44696 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726421AbeLRNqz (ORCPT ); Tue, 18 Dec 2018 08:46:55 -0500 From: Jan Kara To: Al Viro Cc: , Jan Kara Subject: [PATCH 0/2 v2] vfs: Fix crashes when reading /proc/mounts Date: Tue, 18 Dec 2018 14:46:40 +0100 Message-Id: <20181218134642.21219-1-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hello, this is a second revision of the patch series which aims at fixing possible races between functions formatting output for /proc/mounts and friends and remount. Especially ->show_options functions of filesystems are not counting with the fact that options can change under them and thus races can result in bogus output or outright crashes (like was the case with ext4 handling of quota mount option, or udf could crash when printing charset name, or xfs when printing log device name etc.). Since v1, I have changed the logic so that all the locking & restart magic happens in m_show() so that we don't bail back to traverse(), then m_start(), and then back to m_show(). Al, is it better this way? I was not able to get rid of the hold_sb() helper which you didn't like much as namespace_sem is private to fs/namespace.c and we need to drop it after acquiring sb reference and before blocking on sb->s_umount semaphore. So hold_sb() still looked like the least painful solution. Honza