 ext4: fix deadlock when converting an inline directory in nojournal mode · gregkh/linux@5f8b551 · GitHub Skip to content Navigation Menu Toggle navigation Sign in Appearance settings Platform AI CODE CREATION GitHub Copilot Write better code with AI GitHub Spark Build and deploy intelligent apps GitHub Models Manage and compare prompts MCP Registry New Integrate external tools DEVELOPER WORKFLOWS Actions Automate any workflow Codespaces Instant dev environments Issues Plan and track work Code Review Manage code changes APPLICATION SECURITY GitHub Advanced Security Find and fix vulnerabilities Code security Secure your code as you build Secret protection  EXPLORE Why GitHub Documentation Blog Changelog Marketplace View all features Solutions BY COMPANY SIZE Enterprises Small and medium teams Startups Nonprofits BY USE CASE App Modernization DevSecOps DevOps CI/CD View all use cases BY INDUSTRY Healthcare Financial services Manufacturing Government View all industries View all solutions Resources EXPLORE BY TOPIC AI Software Development DevOps Security View all topics EXPLORE BY TYPE Customer stories Events &amp; webinars Ebooks &amp; reports Business insights GitHub Skills SUPPORT &amp; SERVICES Documentation Customer support Community forum Trust center Partners View all resources Open Source COMMUNITY GitHub Sponsors Fund open source developers PROGRAMS Security Lab Maintainer Community Accelerator GitHub Stars Archive Program REPOSITORIES Topics Trending Collections Enterprise ENTERPRISE SOLUTIONS Enterprise platform AI-powered developer platform AVAILABLE ADD-ONS GitHub Advanced Security Enterprise-grade security features Copilot for Business Enterprise-grade AI features Premium Support Enterprise-grade 24/7 support Pricing Search or jump to... Search code, repositories, users, issues, pull requests... --> Search Clear Search syntax tips Provide feedback --> We read every piece of feedback, and take your input very seriously.  Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly --> Name Query To see all available qualifiers, see our documentation . Cancel Create saved search Sign in Sign up Appearance settings Resetting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} gregkh / linux Public Notifications You must be signed in to change notification settings Fork 676 Star 636 Code Actions Security and quality 0 Insights Additional navigation options Code Actions Security and quality Insights Commit 5f8b551 Browse files Browse files tytso authored and gregkh committed ext4: fix deadlock when converting an inline directory in nojournal mode commit f4ce24f upstream. In no journal mode, ext4_finish_convert_inline_dir() can self-deadlock by calling ext4_handle_dirty_dirblock() when it already has taken the directory lock. There is a similar self-deadlock in ext4_incvert_inline_data_nolock() for data files which we'll fix at the same time. A simple reproducer demonstrating the problem: mke2fs -Fq -t ext2 -O inline_data -b 4k /dev/vdc 64 mount -t ext4 -o dirsync /dev/vdc /vdc cd /vdc mkdir file0 cd file0 touch file0 touch file1 attr -s BurnSpaceInEA -V abcde . touch supercalifragilisticexpialidocious Cc: stable@kernel.org Link: https://lore.kernel.org/r/20230507021608.1290720-1-tytso@mit.edu Reported-by: syzbot+91dccab7c64e2850a4e5@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?id=ba84cc80a9491d65416bc7877e1650c87530fe8a Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt; Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt; 1 parent 37c69da commit 5f8b551 Copy full SHA for 5f8b551 1 file changed + 2 - 1 Lines changed: 2 additions &amp; 1 deletion File tree Expand file tree Collapse file tree Open diff view settings Filter options fs/ext4 inline.c Expand file tree Collapse file tree Open diff view settings Collapse file ‎ fs/ext4/inline.c ‎ Copy file name to clipboard Expand all lines: fs/ext4/inline.c + 2 - 1 Lines changed: 2 additions &amp; 1 deletion Original file line number Diff line number Diff line change @@ -1172,6 +1172,7 @@ static int ext4_finish_convert_inline_dir(handle_t *handle, 1172 1172 ext4_initialize_dirent_tail ( dir_block , 1173 1173 inode -&gt; i_sb -&gt; s_blocksize ); 1174 1174 set_buffer_uptodate ( dir_block ); 1175 + unlock_buffer ( dir_block ); 1175 1176 err = ext4_handle_dirty_dirblock ( handle , inode , dir_block ); 1176 1177 if ( err ) 1177 1178 return err ; @@ -1245,14 +1246,14 @@ static int ext4_convert_inline_data_nolock(handle_t *handle, 1245 1246 if (! S_ISDIR ( inode -&gt; i_mode )) { 1246 1247 memcpy ( data_bh -&gt; b_data , buf , inline_size ); 1247 1248 set_buffer_uptodate ( data_bh ); 1249 + unlock_buffer ( data_bh ); 1248 1250 error = ext4_handle_dirty_metadata ( handle , 1249 1251 inode , data_bh ); 1250 1252 } else { 1251 1253 error = ext4_finish_convert_inline_dir ( handle , inode , data_bh , 1252 1254 buf , inline_size ); 1253 1255 } 1254 1256 1255 - unlock_buffer ( data_bh ); 1256 1257 out_restore : 1257 1258 if ( error ) 1258 1259 ext4_restore_inline_data ( handle , inode , iloc , buf , inline_size ); 0 commit comments Comments 0 ( 0 ) Footer &copy; 2026 GitHub,&nbsp;Inc. Footer navigation Terms Privacy Security Status Community Docs Contact Manage cookies Do not share my personal information You can’t perform that action at this time. 