Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932117Ab3EXDkZ (ORCPT ); Thu, 23 May 2013 23:40:25 -0400 Received: from mail-ee0-f49.google.com ([74.125.83.49]:57404 "EHLO mail-ee0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759883Ab3EXDkU (ORCPT ); Thu, 23 May 2013 23:40:20 -0400 MIME-Version: 1.0 Date: Fri, 24 May 2013 13:40:19 +1000 Message-ID: Subject: BUG_ON in virtio-ring.c From: Dave Airlie To: Rusty Russell , LKML Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 939 Lines: 24 Hi Rusty, current virtio-ring.c has a BUG_ON in virtqueue_add that checks total_sg > vg->vring.num, however I'm not sure it really is 100% correct. If I have an indirect ring and I'm adding sgs to it and the host is delayed (say I've got a thread consuming things from the vring and its off doing something interesting), I'd really like to get ENOSPC back from virtqueue_add. However if the indirect addition fails due to free_sg being 0, we hit the BUG_ON before we ever get to the ENOSPC check. the BUG_ON is quite valid in the no indirect case, but when we have indirect buffers it doesn't seem like it always makes sense. Not sure best way to fix it, I'm just a virtio newbie :) Dave. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/