linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfs: test for shut down fs in xfs_dir_fsync()
@ 2014-04-28 16:35 Eric Sandeen
  2014-04-28 16:47 ` Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Eric Sandeen @ 2014-04-28 16:35 UTC (permalink / raw)
  To: xfs-oss; +Cc: Boris Ranto

Similar to xfs_file_fsync(), I think xfs_dir_fsync() needs
to test for a shut down fs, lest we go down paths we'll
never be able to complete; Boris reported that during some
stress tests he had threads stuck in xlog_cil_force_lsn
via xfs_dir_fsync().

[ 3663.361709] sfsuspend-par   D ffff88042f0b4540     0  3981   3947 0x00000080

[ 3663.394472] Call Trace:
[ 3663.397199]  [<ffffffff815f1889>] schedule+0x29/0x70
[ 3663.402743]  [<ffffffffa01feda5>] xlog_cil_force_lsn+0x185/0x1a0 [xfs]
[ 3663.416249]  [<ffffffffa01fd3af>] _xfs_log_force_lsn+0x6f/0x2f0 [xfs]
[ 3663.429271]  [<ffffffffa01a339d>] xfs_dir_fsync+0x7d/0xe0 [xfs]
[ 3663.435873]  [<ffffffff811df8c5>] do_fsync+0x65/0xa0
[ 3663.441408]  [<ffffffff811dfbc0>] SyS_fsync+0x10/0x20
[ 3663.447043]  [<ffffffff815fc7d9>] system_call_fastpath+0x16/0x1b

Reported-by: Boris Ranto <branto@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

NB: While I've not asked Boris to test this yet, it seems
clear (?) that dir_fsync should behave the same as
file_fsync() in the face of a shut-down fs.

diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 4c749ab..2b94362 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -146,6 +146,9 @@ xfs_dir_fsync(
 
 	trace_xfs_dir_fsync(ip);
 
+	if (XFS_FORCED_SHUTDOWN(mp))
+		return -XFS_ERROR(EIO);
+
 	xfs_ilock(ip, XFS_ILOCK_SHARED);
 	if (xfs_ipincount(ip))
 		lsn = ip->i_itemp->ili_last_lsn;

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2014-09-12 19:29 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-28 16:35 [PATCH] xfs: test for shut down fs in xfs_dir_fsync() Eric Sandeen
2014-04-28 16:47 ` Christoph Hellwig
2014-04-28 17:18   ` Eric Sandeen
2014-04-28 17:22     ` Mark Tinguely
2014-04-28 17:26       ` Eric Sandeen
2014-04-28 17:49         ` Mark Tinguely
2014-04-28 17:53           ` Eric Sandeen
2014-04-29 10:24           ` Boris Ranto
2014-04-28 20:54 ` Dave Chinner
2014-04-28 21:39   ` Mark Tinguely
2014-04-28 22:18     ` Dave Chinner
2014-04-28 23:00       ` Mark Tinguely
2014-04-29 12:56       ` Brian Foster
2014-04-29 20:12         ` Dave Chinner
2014-07-21 15:33   ` Eric Sandeen
2014-09-12 19:29 ` Eric Sandeen

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).