linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs: block pipe_write() on a frozen filesystem
@ 2012-09-27 15:47 Eric Sandeen
  2012-10-01 15:34 ` Jan Kara
  2013-04-02 12:38 ` [PATCH] fs: block pipe_write() on a frozen filesystem PING Dmitry Monakhov
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Sandeen @ 2012-09-27 15:47 UTC (permalink / raw)
  To: linux-fsdevel@vger.kernel.org
  Cc: Jan Kara, Fernando Luis Vazquez Cao, Al Viro

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 <sandeen@redhat.com>
---

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;
 }
 


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-04-02 20:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-27 15:47 [PATCH] fs: block pipe_write() on a frozen filesystem Eric Sandeen
2012-10-01 15:34 ` Jan Kara
2013-04-02 12:38 ` [PATCH] fs: block pipe_write() on a frozen filesystem PING Dmitry Monakhov
2013-04-02 19:57   ` Al Viro
2013-04-02 20:30     ` Dmitry Monakhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).