Remove udev_update flag, which was used to avoid udev property update as NULL 87/157587/1
authorHyotaek Shim <hyotaek.shim@samsung.com>
Wed, 25 Oct 2017 08:01:08 +0000 (17:01 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Wed, 25 Oct 2017 08:03:33 +0000 (08:03 +0000)
(The device-mapper sync-mode patch resolved the problem(NULL update).)

Change-Id: I82381b55ab3c745d9f2a45caa6ce6d587c0c80b3
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
(cherry picked from commit f8c69df5bd108ade6f1941672b56ae951494dc9e)

src/block/block.c

index 914af6b..c17d7c4 100644 (file)
@@ -152,7 +152,6 @@ struct format_data {
        struct block_device *bdev;
        char *fs_type;
        enum unmount_operation option;
-       bool udev_update;
 };
 
 struct pipe_data {
@@ -1445,7 +1444,7 @@ out:
 }
 
 static int block_format(struct block_data *data,
-               const char *fs_type, bool mount_point_updated, bool udev_update)
+               const char *fs_type, bool mount_point_updated)
 {
        const struct block_fs_ops *fs;
        dd_list *elem;
@@ -1490,15 +1489,14 @@ static int block_format(struct block_data *data,
 
        /* need to update the partition data.
         * It can be changed in doing format. */
-       if (udev_update)
-               retrieve_udev_device(data, mount_point_updated);
+       retrieve_udev_device(data, mount_point_updated);
 out:
        return r;
 }
 
 static int format_block_device(struct block_device *bdev,
                const char *fs_type,
-               enum unmount_operation option, bool udev_update)
+               enum unmount_operation option)
 {
        struct block_data *data;
        int r;
@@ -1519,7 +1517,7 @@ static int format_block_device(struct block_device *bdev,
                }
        }
 
-       r = block_format(data, fs_type, bdev->mount_point_updated, udev_update);
+       r = block_format(data, fs_type, bdev->mount_point_updated);
        if (r < 0)
                _E("fail to format %s device : %d", data->devnode, r);
 
@@ -1534,7 +1532,7 @@ out:
 }
 
 static struct format_data *get_format_data(
-               const char *fs_type, enum unmount_operation option, bool udev_update)
+               const char *fs_type, enum unmount_operation option)
 {
        struct format_data *fdata;
 
@@ -1549,7 +1547,6 @@ static struct format_data *get_format_data(
        else
                fdata->fs_type = NULL;
        fdata->option = option;
-       fdata->udev_update = udev_update;
 
        return fdata;
 }
@@ -1617,7 +1614,7 @@ static int block_format_device(struct block_device *bdev, void *data)
                goto out;
        }
 
-       ret = format_block_device(bdev, fdata->fs_type, fdata->option, fdata->udev_update);
+       ret = format_block_device(bdev, fdata->fs_type, fdata->option);
        if (ret < 0)
                _E("fail to mount block device for %s", bdev->data->devnode);
 
@@ -2209,7 +2206,7 @@ static int add_block_device(struct udev_device *dev, const char *devnode, bool m
        if (need_format) {
                struct format_data *fdata;
 
-               fdata = get_format_data(NULL, 1, true);
+               fdata = get_format_data(NULL, UNMOUNT_FORCE);
                if (!fdata) {
                        _E("Failed to get format data");
                        return -ENOMEM;
@@ -2938,7 +2935,7 @@ static DBusMessage *request_format_block(dbus_method_reply_handle_h reply_handle
                goto out;
        }
 
-       fdata = get_format_data(NULL, option, true);
+       fdata = get_format_data(NULL, option);
        if (!fdata) {
                _E("Failed to get format data");
                goto out;
@@ -3014,7 +3011,7 @@ static DBusMessage *request_format_block_type(dbus_method_reply_handle_h reply_h
                goto out;
        }
 
-       fdata = get_format_data(type, option, true);
+       fdata = get_format_data(type, option);
        if (!fdata) {
                _E("Failed to get format data");
                goto out;