summaryrefslogtreecommitdiff
path: root/ipc/msgutil.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2019-11-05 17:44:11 +0100
committerTheodore Ts'o <tytso@mit.edu>2019-11-05 12:13:25 -0500
commit9b88f9fb0d2fc8f7e71e75a42c5a064bc6cfffd2 (patch)
treeddf3f8ea6c1000bad300072104cf00b5b1fe8558 /ipc/msgutil.c
parenta9e26328adfa82b1f3c941bc6e3daea47631abce (diff)
ext4: Do not iput inode under running transaction
When ext4_mkdir(), ext4_symlink(), ext4_create(), or ext4_mknod() fail to add entry into directory, it ends up dropping freshly created inode under the running transaction and thus inode truncation happens under that transaction. That breaks assumptions that evict() does not get called from a transaction context and at least in ext4_symlink() case it can result in inode eviction deadlocking in inode_wait_for_writeback() when flush worker finds symlink inode, starts to write it back and blocks on starting a transaction. So change the code in ext4_mkdir() and ext4_add_nondir() to drop inode reference only after the transaction is stopped. We also have to add inode to the orphan list in that case as otherwise the inode would get leaked in case we crash before inode deletion is committed. CC: stable@vger.kernel.org Signed-off-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20191105164437.32602-5-jack@suse.cz Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'ipc/msgutil.c')
0 files changed, 0 insertions, 0 deletions