]> git.karo-electronics.de Git - linux-beck.git/commitdiff
UBI: Dispatch update notification if the volume is updated
authorEzequiel Garcia <ezequiel.garcia@free-electrons.com>
Fri, 29 Aug 2014 21:42:30 +0000 (18:42 -0300)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Tue, 16 Sep 2014 16:02:05 +0000 (19:02 +0300)
The UBI_IOCVOLUP ioctl is used to start an update and also to
truncate a volume. In the first case, a "volume updated" notification
is dispatched when the update is done.

This commit adds the "volume updated" notification to be also sent when
the volume is truncated. This is required for UBI block and gluebi to get
notified about the new volume size.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: stable@vger.kernel.org # v3.15+
drivers/mtd/ubi/cdev.c

index 7646220ca6e26dd4d687d6cca32de24d7d526977..20aeb277d8d4ae2bbf84c62039dddf601b2f9189 100644 (file)
@@ -425,8 +425,10 @@ static long vol_cdev_ioctl(struct file *file, unsigned int cmd,
                        break;
 
                err = ubi_start_update(ubi, vol, bytes);
-               if (bytes == 0)
+               if (bytes == 0) {
+                       ubi_volume_notify(ubi, vol, UBI_VOLUME_UPDATED);
                        revoke_exclusive(desc, UBI_READWRITE);
+               }
                break;
        }