From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754135AbdE0IXm (ORCPT ); Sat, 27 May 2017 04:23:42 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:54683 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751411AbdE0IXk (ORCPT ); Sat, 27 May 2017 04:23:40 -0400 Date: Sat, 27 May 2017 01:23:38 -0700 From: Christoph Hellwig To: Hyunchul Lee Cc: Richard Weinberger , Artem Bityutskiy , adrian.hunter@intel.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mtd@lists.infradead.org, kernel-team@lge.com Subject: Re: [PATCH] ubifs: Add freeze support Message-ID: <20170527082338.GC32125@infradead.org> References: <1495755004-17036-1-git-send-email-hyc.lee@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1495755004-17036-1-git-send-email-hyc.lee@gmail.com> User-Agent: Mutt/1.8.0 (2017-02-23) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +static int ubifs_freeze_super(struct super_block *sb) > +{ > + struct ubifs_info *c = sb->s_fs_info; > + int err; > + > + dbg_gen("starting"); > + /* freeze_super always succeeds if file system is in read-only. > + * however if there are errors, UBIFS is switched to read-only mode. > + * so @ro_error should be checked. > + */ > + err = freeze_super(sb); > + if (!err && c->ro_error) { > + thaw_super(sb); > + return -EIO; > + } > + return err; This is just broken. First ubifs should still properly propagate the errors, and second freezing/unfreezing read only file systems is perfectly valid, and third the freeze_super method is a special hack for gfs2 that should not gain additional users.