]> Pileus Git - ~andy/linux/commitdiff
drbd: Don't use empty nested netlink attributes
authorAndreas Gruenbacher <agruen@linbit.com>
Tue, 24 May 2011 12:18:31 +0000 (14:18 +0200)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 8 Nov 2012 15:57:40 +0000 (16:57 +0100)
Before mainline commit ea5693cc (v2.6.29-rc1), empty nested netlink attributes
were not allowed.  Fix that by leaving out nested attributes if they are empty
and by allowing the top-level attributes to be missing.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_nl.c

index c9ecb7b04c1fc3800408aa98fd74c4e0ed7651f9..59923db780b9c92f32d49ffb7b72c84e6caabc25 100644 (file)
@@ -1155,7 +1155,7 @@ int drbd_adm_disk_opts(struct sk_buff *skb, struct genl_info *info)
                set_disk_conf_defaults(new_disk_conf);
 
        err = disk_conf_from_attrs_for_change(new_disk_conf, info);
-       if (err) {
+       if (err && err != -ENOMSG) {
                retcode = ERR_MANDATORY_TAG;
                drbd_msg_put_info(from_attrs_err_to_txt(err));
        }
@@ -1902,7 +1902,7 @@ int drbd_adm_net_opts(struct sk_buff *skb, struct genl_info *info)
                set_net_conf_defaults(new_conf);
 
        err = net_conf_from_attrs_for_change(new_conf, info);
-       if (err) {
+       if (err && err != -ENOMSG) {
                retcode = ERR_MANDATORY_TAG;
                drbd_msg_put_info(from_attrs_err_to_txt(err));
                goto fail;
@@ -2337,7 +2337,7 @@ int drbd_adm_resource_opts(struct sk_buff *skb, struct genl_info *info)
                set_res_opts_defaults(&res_opts);
 
        err = res_opts_from_attrs(&res_opts, info);
-       if (err) {
+       if (err && err != -ENOMSG) {
                retcode = ERR_MANDATORY_TAG;
                drbd_msg_put_info(from_attrs_err_to_txt(err));
                goto fail;