From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE1C83B14CB for ; Fri, 17 Jul 2026 10:53:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784285624; cv=none; b=IXTRTmcDOI9qrbntxizVxGl7d9bk/3fmSKhfaFmIPfOhjM1c8baBhI+4R+kCGeev3trwzks9lzIy7hag2LzNe4u9I5smiPYNg5MAzO+/QASFdi8Da9PxtwLKl7K27CkxU1IsLNv82fmMoYwSsBLGffgouWuQ3JroW/DbGfp5CPk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784285624; c=relaxed/simple; bh=6clqZ8rcxZ7d/R4sgBWueUhQGElzdVzDHyrmLhG/Dcg=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=OZ6Jb7k2VUx0aWV+gMzsmct/YAFsSqEHuvVkGqKpaczefc/s0h10qYSNHWs7dP9r042yrxB3YCZRLpI3p9YUrNSnG+X5+gofm6Rx6uRNKhgUtrMeXnp1Fva6Tqx+FTLN4/P5IVJiiVXlE5+gqE82wikXpN44RVR1c+mj6QRfxPA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.167.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oi1-f199.google.com with SMTP id 5614622812f47-4a42c572645so6260514b6e.0 for ; Fri, 17 Jul 2026 03:53:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784285621; x=1784890421; h=content-type:to:from:subject:message-id:in-reply-to:date :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=UMrizpRkNJoHGSAT6yg8Ap20w+HIGr3RzNTNnrCMPyo=; b=Q8SMzdLES2VThpTrmamnvrIebd5oPZKm/kyvB/N0v82avOB49SteoTAJQwmAsnDBJi q4bKkkJ8kLmzrYbXIBizQL7nqakI6BRmX0SBKtX5nVXOd/dc6sV9yJ70X/7VAqa1z2cV 8W74PTmZiAT4ysthyAE8FHA4xFjaSqsJejjkbmTBGh8aN7A2wVvDgTWnydoMqIin5LOv CMi8w+jqRchjZi8V0XAAGEyThqomB7s0KGuLmIUh0/R/uQUnQeMYFcKN5MlbiZMFIb7J 5RHvtPAKrWNvd6Z11ZEN9aoC6V0CymhhBbcPVtUguOjWyREkAshqiKaEi1xH7eEB5wiS DK8g== X-Gm-Message-State: AOJu0YxOpN92EAXMNMxwD4puV5Hxt3cJnLhOrBIsZr7RV6YWHRx1apxS Cs4yZWA16RD+nvJjwA9V0oxM3BkZ5n56eDyvFdJ18lwDEyapyvK0LX2NCPsnaMEfPGy705C0p7j y+eCjFs85Aelr4NrsiMQcZCz9+LuUDKQ6KiPNsfE3gqaXpzVgr+nxQUnalj0= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6808:14d5:b0:4a4:c09:6a4 with SMTP id 5614622812f47-4a4d038f70cmr928702b6e.10.1784285621470; Fri, 17 Jul 2026 03:53:41 -0700 (PDT) Date: Fri, 17 Jul 2026 03:53:41 -0700 In-Reply-To: <6a588d44.c96faac9.59e0.0012.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a5a09b5.5028b7d0.1f0bb.001b.GAE@google.com> Subject: Forwarded: [PATCH] ext4: make ext4_write_inline_data_end() handle file conversion gracefully From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] ext4: make ext4_write_inline_data_end() handle file conversion gracefully Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci Replace BUG_ON(!ext4_has_inline_data(inode)) with a defensive check in ext4_write_inline_data_end(). A file can be converted from inline to block storage by concurrent paths while a write completion is in flight. When this race occurs, the write completion handler should gracefully fall back to block_write_end() instead of crashing. The data in the folio can still be written to block storage via the fallback path. This handles all inline-to-block conversion races regardless of which lock protects the conversion (i_data_sem, xattr_sem, etc.). Reported-by: syzbot+293a57918b36cfae3d48@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=293a57918b36cfae3d48 Signed-off-by: Deepanshu Kartikey --- fs/ext4/inline.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index 8045e4ff270c..04b9cd01fd7b 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -812,7 +812,11 @@ int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len, goto out; } ext4_write_lock_xattr(inode, &no_expand); - BUG_ON(!ext4_has_inline_data(inode)); + /* File may have been converted to block storage by concurrent path */ + if (!ext4_has_inline_data(inode)) { + ext4_write_unlock_xattr(inode, &no_expand); + return block_write_end(pos, len, copied, folio); + } /* * ei->i_inline_off may have changed since -- 2.43.0