 ext4: fix deadlock when converting an inline directory in nojournal mode · gregkh/linux@665cc3b · 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 665cc3b 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 f68876a commit 665cc3b Copy full SHA for 665cc3b 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 @@ -1178,6 +1178,7 @@ static int ext4_finish_convert_inline_dir(handle_t *handle, 1178 1178 ext4_initialize_dirent_tail ( dir_block , 1179 1179 inode -&gt; i_sb -&gt; s_blocksize ); 1180 1180 set_buffer_uptodate ( dir_block ); 1181 + unlock_buffer ( dir_block ); 1181 1182 err = ext4_handle_dirty_dirblock ( handle , inode , dir_block ); 1182 1183 if ( err ) 1183 1184 return err ; @@ -1252,14 +1253,14 @@ static int ext4_convert_inline_data_nolock(handle_t *handle, 1252 1253 if (! S_ISDIR ( inode -&gt; i_mode )) { 1253 1254 memcpy ( data_bh -&gt; b_data , buf , inline_size ); 1254 1255 set_buffer_uptodate ( data_bh ); 1256 + unlock_buffer ( data_bh ); 1255 1257 error = ext4_handle_dirty_metadata ( handle , 1256 1258 inode , data_bh ); 1257 1259 } else { 1258 1260 error = ext4_finish_convert_inline_dir ( handle , inode , data_bh , 1259 1261 buf , inline_size ); 1260 1262 } 1261 1263 1262 - unlock_buffer ( data_bh ); 1263 1264 out_restore : 1264 1265 if ( error ) 1265 1266 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. 