From patchwork Wed Jan 18 15:46:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ayan George X-Patchwork-Id: 136836 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id ECE461007D3 for ; Thu, 19 Jan 2012 23:33:54 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1RnrBX-0001bv-7A; Thu, 19 Jan 2012 12:33:43 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1RnXj2-0001aS-Bx for kernel-team@lists.ubuntu.com; Wed, 18 Jan 2012 15:47:00 +0000 Received: from fl-69-69-27-16.sta.embarqhsd.net ([69.69.27.16] helo=[172.16.0.4]) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1RnXj2-0002GG-5f for kernel-team@lists.ubuntu.com; Wed, 18 Jan 2012 15:47:00 +0000 Message-ID: <4F16E971.8020800@canonical.com> Date: Wed, 18 Jan 2012 10:46:57 -0500 From: Ayan George User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111229 Thunderbird/9.0 MIME-Version: 1.0 To: kernel-team@lists.ubuntu.com Subject: [Oneiric][SRU] Fix loop device notificaitons. X-Enigmail-Version: 1.3.4 X-Mailman-Approved-At: Thu, 19 Jan 2012 12:33:40 +0000 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com SRU Justification: Impact: The loop device does not emit a change uevent when autoreleasing a device. Programs that depend on uevents (like gvfs and ultimately Nautilus) never notice when loop devices are unmounted. Bug-Link: https://bugs.launchpad.net/ubuntu/+source/usb-creator/+bug/548546 Fix: Apply 8a9c594422ecad912d6470888acdee9a1236ad68 from linux mainline -- Pass a valid bdev pointer to loop_clr_fd() instead of NULL so that it will emit the uevent. The patch is very small and applies cleanly to ubuntu-oneiric. Testcase: (1) In a terminal, start udevadm in monitor mode: $ udevadm monitor (2) In another terminal, mount an ISO image using the loopback device: $ sudo mount -o loop -t iso9660 your_image.iso /mnt (3) Notice the change uevents that udevadm reports. (4) Unmount image: $ sudo umount /mnt (5) Note that udevadm does not report any changes. With the patch applied, you will see the kernel noticiations. From 8a9c594422ecad912d6470888acdee9a1236ad68 Mon Sep 17 00:00:00 2001 From: Phillip Susi Date: Wed, 21 Sep 2011 10:02:13 +0200 Subject: [PATCH] drivers/block/loop.c: emit uevent on auto release The loopback driver failed to emit the change uevent when auto releasing the device. Fixed lo_release() to pass the bdev to loop_clr_fd() so it can emit the event. Signed-off-by: Phillip Susi Cc: Jens Axboe Cc: Ayan George Signed-off-by: Andrew Morton Signed-off-by: Jens Axboe --- drivers/block/loop.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index b336433..c2ce03c 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1583,7 +1583,7 @@ static int lo_release(struct gendisk *disk, fmode_t mode) * In autoclear mode, stop the loop thread * and remove configuration after last close. */ - err = loop_clr_fd(lo, NULL); + err = loop_clr_fd(lo, lo->lo_device); if (!err) goto out_unlocked; } else { -- 1.7.5.4