From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8028BC2F421 for ; Mon, 21 Jan 2019 16:58:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 54FA420663 for ; Mon, 21 Jan 2019 16:58:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729974AbfAUQ6b (ORCPT ); Mon, 21 Jan 2019 11:58:31 -0500 Received: from mx2.suse.de ([195.135.220.15]:51580 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729408AbfAUQ6b (ORCPT ); Mon, 21 Jan 2019 11:58:31 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 889BEAE1D; Mon, 21 Jan 2019 16:58:30 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 4DD361E1584; Mon, 21 Jan 2019 17:58:30 +0100 (CET) Date: Mon, 21 Jan 2019 17:58:30 +0100 From: Jan Kara To: Al Viro Cc: linux-fsdevel@vger.kernel.org, Jan Kara Subject: Re: [PATCH 0/2 v2] vfs: Fix crashes when reading /proc/mounts Message-ID: <20190121165830.GE21694@quack2.suse.cz> References: <20181218134642.21219-1-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181218134642.21219-1-jack@suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Ping Al? On Tue 18-12-18 14:46:40, Jan Kara wrote: > 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 -- Jan Kara SUSE Labs, CR