From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Sandeen Subject: [PATCH] fs: block pipe_write() on a frozen filesystem Date: Thu, 27 Sep 2012 10:47:59 -0500 Message-ID: <5064752F.5000207@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Jan Kara , Fernando Luis Vazquez Cao , Al Viro To: "linux-fsdevel@vger.kernel.org" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:25561 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751921Ab2I0PsF (ORCPT ); Thu, 27 Sep 2012 11:48:05 -0400 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: I noticed that this can sneak past a frozen filesystem: # mkfifo /mnt/test/fifo # echo foo > /mnt/test/fifo & # fsfreeze -f /mnt/test # cat /mnt/test/fifo and we get a warning that jbd2 has entered a transaction while frozen: WARNING: at fs/ext4/super.c:240 ext4_journal_start_sb+0xce/0xe0 [ext4]() (Not tainted) which is: WARN_ON(sb->s_writers.frozen == SB_FREEZE_COMPLETE); and we get there via the file_update_time() path in pipe_write(). Signed-off-by: Eric Sandeen --- Is this too big a hammer? file_update_time() is conditional... diff --git a/fs/pipe.c b/fs/pipe.c index 8d85d70..d19a709 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -501,6 +501,7 @@ pipe_write(struct kiocb *iocb, const struct iovec *_iov, do_wakeup = 0; ret = 0; + sb_start_write(inode->i_sb); mutex_lock(&inode->i_mutex); pipe = inode->i_pipe; @@ -659,6 +660,7 @@ out: if (err) ret = err; } + sb_end_write(inode->i_sb); return ret; }