 ext4: fix deadlock when converting an inline directory in nojournal mode · gregkh/linux@640c8c3 · 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 640c8c3 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 b253193 commit 640c8c3 Copy full SHA for 640c8c3 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 @@ -1185,6 +1185,7 @@ static int ext4_finish_convert_inline_dir(handle_t *handle, 1185 1185 ext4_initialize_dirent_tail ( dir_block , 1186 1186 inode -&gt; i_sb -&gt; s_blocksize ); 1187 1187 set_buffer_uptodate ( dir_block ); 1188 + unlock_buffer ( dir_block ); 1188 1189 err = ext4_handle_dirty_dirblock ( handle , inode , dir_block ); 1189 1190 if ( err ) 1190 1191 return err ; @@ -1259,14 +1260,14 @@ static int ext4_convert_inline_data_nolock(handle_t *handle, 1259 1260 if (! S_ISDIR ( inode -&gt; i_mode )) { 1260 1261 memcpy ( data_bh -&gt; b_data , buf , inline_size ); 1261 1262 set_buffer_uptodate ( data_bh ); 1263 + unlock_buffer ( data_bh ); 1262 1264 error = ext4_handle_dirty_metadata ( handle , 1263 1265 inode , data_bh ); 1264 1266 } else { 1265 1267 error = ext4_finish_convert_inline_dir ( handle , inode , data_bh , 1266 1268 buf , inline_size ); 1267 1269 } 1268 1270 1269 - unlock_buffer ( data_bh ); 1270 1271 out_restore : 1271 1272 if ( error ) 1272 1273 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. 