From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933092AbbIDRUy (ORCPT ); Fri, 4 Sep 2015 13:20:54 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:21782 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932955AbbIDRUw (ORCPT ); Fri, 4 Sep 2015 13:20:52 -0400 Message-ID: <55E9D2EA.4020106@oracle.com> Date: Fri, 04 Sep 2015 13:20:42 -0400 From: Sasha Levin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Tejun Heo CC: rostedt@goodmis.org, mingo@redhat.com, axboe@fb.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] writeback: verify that underlying dev exists before getting its name References: <1441385118-27199-1-git-send-email-sasha.levin@oracle.com> <20150904164729.GD25329@mtj.duckdns.org> In-Reply-To: <20150904164729.GD25329@mtj.duckdns.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/04/2015 12:47 PM, Tejun Heo wrote: > On Fri, Sep 04, 2015 at 12:45:18PM -0400, Sasha Levin wrote: >> We can't assume there is always an underlying device and must verify that >> as well. Otherwise, we'd deref a NULL ptr here. > > Do you have backtrace of this happening? There's a bug in cleanup > path which causes oops (patch is being tested) and this may just be a > symptom of the same problem. > > Thanks. > [268773.335933] kasan: GPF could be caused by NULL-ptr deref or user memory accessgeneral protection fault: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC KASAN [268773.337986] Modules linked in: [268773.338470] CPU: 3 PID: 12812 Comm: trinity-c10 Not tainted 4.2.0-next-20150902-sasha-00045-gd0866f3-dirty #2528 [268773.339903] task: ffff8802f56e4000 ti: ffff880322e10000 task.ti: ffff880322e10000 [268773.340943] RIP: 0010:[] [] trace_event_raw_event_writeback_dirty_page+0x1b4/0x420 [268773.342558] RSP: 0018:ffff880322e17810 EFLAGS: 00010006 [268773.343316] RAX: 0000000000000000 RBX: 1ffff100645c2f04 RCX: 0000000000000027 [268773.344321] RDX: dffffc0000000000 RSI: 1ffffffff725af7f RDI: 0000000000000138 [268773.345332] RBP: ffff880322e178c8 R08: 000000000000006e R09: 0000000000000004 [268773.346339] R10: ffff8801e38c6008 R11: 1ffff1003c716a86 R12: ffff8801e38c6b3c [268773.347504] R13: ffff8802bf107060 R14: ffffea0002cde080 R15: ffff880322e17840 [268773.348582] FS: 00007f4ebe605700(0000) GS:ffff8801e4000000(0000) knlGS:0000000000000000 [268773.349800] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [268773.350666] CR2: 0000000000000004 CR3: 00000002f5df4000 CR4: 00000000000006a0 [268773.351712] Stack: [268773.352038] ffff8801e38c6afc ffff8802f56e4000 0000000041b58ab3 ffffffffb6c9fdd7 [268773.353217] ffffffffaa8b80d0 0000000000000005 ffff88006bc04800 ffff8801e38c6b38 [268773.354386] ffff88006be0e9a0 ffff8801e38c6b3c 0000000000000082 ffffffff00000004 [268773.355659] Call Trace: [268773.356090] [] ? inode_congested+0x520/0x520 [268773.357088] [] ? lock_is_held+0x194/0x1f0 [268773.357996] [] account_page_dirtied+0x443/0x740 [268773.358881] [] __set_page_dirty_nobuffers+0xf0/0x2f0 [268773.359893] [] migrate_page_copy+0xccd/0x1980 [268773.360900] [] ? lock_acquired+0x680/0xbe0 [268773.361793] [] ? aio_migratepage+0x22c/0x370 [268773.362697] [] aio_migratepage+0x23b/0x370 [268773.363589] [] move_to_new_page+0x1fc/0x490 [268773.364487] [] ? fallback_migrate_page+0x3b0/0x3b0 [268773.365474] [] ? page_remove_rmap+0x450/0x450 [268773.366380] [] ? invalid_migration_vma+0x60/0x60 [268773.367353] [] ? page_get_anon_vma+0x2c0/0x2c0 [268773.368260] [] ? new_page_node+0x263/0x3b0 [268773.369124] [] ? ___might_sleep+0x34e/0x470 [268773.370025] [] migrate_pages+0x1263/0x1ee0 [268773.370916] [] ? get_lock_stats+0x1b/0x80 [268773.371770] [] ? alloc_misplaced_dst_page+0x80/0x80 [268773.372756] [] ? buffer_migrate_page+0x2e0/0x2e0 [268773.373708] [] ? follow_page_pte+0x95f/0xa15 [268773.374621] [] ? follow_page_mask+0x4e6/0xa90 [268773.375570] [] SYSC_move_pages+0xa9e/0x1070 [268773.376446] [] ? SYSC_move_pages+0xf3/0x1070 [268773.377388] [] ? migrate_pages+0x1ee0/0x1ee0 [268773.378333] [] ? ring_buffer_unlock_commit+0x2f7/0x450 [268773.379361] [] ? trace_buffer_unlock_commit+0x63/0x70 [268773.380403] [] ? do_audit_syscall_entry+0x310/0x310 [268773.381412] [] ? syscall_trace_enter_phase2+0x2db/0x690 [268773.382479] [] SyS_move_pages+0xe/0x10 [268773.383356] [] tracesys_phase2+0x88/0x8d [268773.384186] Code: e9 03 80 3c 11 00 0f 85 b5 01 00 00 48 8b 80 b0 06 00 00 48 ba 00 00 00 00 00 fc ff df 48 8d b8 38 01 00 00 48 89 f9 48 c1 e9 03 <80> 3c 11 00 0f 85 74 01 00 00 48 8b b0 38 01 00 00 48 85 f6 0f [268773.388757] RIP [] trace_event_raw_event_writeback_dirty_page+0x1b4/0x420 [268773.389999] RSP Thanks, Sasha