linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Recipe for creating unlink deadlocks
@ 2015-05-07 22:20 Zygo Blaxell
  2015-05-08 10:32 ` Filipe David Manana
  0 siblings, 1 reply; 6+ messages in thread
From: Zygo Blaxell @ 2015-05-07 22:20 UTC (permalink / raw)
  To: linux-btrfs

[-- Attachment #1: Type: text/plain, Size: 1400 bytes --]

This is the simplest repro recipe for this that I have found so far.
It takes only a few minutes for the rm processes to get stuck here:

# cat /proc/28396/stack                                                                                                                                       Thu May  7 18:13:05 2015

[<ffffffff813c8a2d>] lock_extent_bits+0x1ad/0x200
[<ffffffff813b5dfa>] btrfs_evict_inode+0x17a/0x5e0
[<ffffffff8123fc68>] evict+0xb8/0x1b0
[<ffffffff81240813>] iput+0x1f3/0x260
[<ffffffff81233c68>] do_unlinkat+0x1d8/0x360
[<ffffffff812346db>] SyS_unlinkat+0x1b/0x40
[<ffffffff8190024d>] system_call_fastpath+0x16/0x1b
[<ffffffffffffffff>] 0xffffffffffffffff


Run these three scripts in a directory that is the top of a subvol:

	# Script #1:  randomly create or delete snapshots
	while sleep 1; do
		if [ $[RANDOM%2] = 0 ]; then
			btrfs sub snap . snaps-$RANDOM
		else
			for x in snaps-*; do
				btrfs sub del $x
				break
			done
			btrfs sub sync .
		fi
	done 

	# Script #2:  create a bunch of files of random sizes
	while true; do
		d=$[RANDOM%9]/$[RANDOM%9]/$[RANDOM%9]/$[RANDOM%9]
		mkdir -p ${d%/*}
		head -c $[RANDOM%1024]k /usr/share/doc/chromium/copyright > $d
	done 

	# Script #3:  read and immediately delete all the files
	while date; do
		sleep 1
		find -type f -exec cat {} \; -exec rm -fv {} \; > /dev/null
	done 


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

end of thread, other threads:[~2015-05-14 19:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-07 22:20 Recipe for creating unlink deadlocks Zygo Blaxell
2015-05-08 10:32 ` Filipe David Manana
2015-05-08 13:21   ` Zygo Blaxell
     [not found]     ` <20150513053340.GF18025@hungrycats.org>
2015-05-13 23:07       ` Recipe for creating unlink deadlocks (v2, verified on 4.1-rc3) (resend) Zygo Blaxell
2015-05-14 12:25         ` Filipe David Manana
2015-05-14 19:45           ` Filipe David Manana

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