]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
storage/dir: remove error handling down
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 28 Apr 2021 09:27:58 +0000 (11:27 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 28 Apr 2021 09:27:58 +0000 (11:27 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/storage/dir.c

index 223aecaab96e03b22a2824e0001d964449451a05..cc7b7329ddceb811c01eee9d5a4babd659724295 100644 (file)
@@ -170,8 +170,6 @@ int dir_mount(struct lxc_storage *bdev)
                                            "", PROTECT_OPATH_DIRECTORY,
                                            PROTECT_LOOKUP_BENEATH, 0, true);
                }
-               if (ret < 0)
-                       return syserror("Failed to mount \"%s\" onto \"%s\"", source, target);
        } else {
                ret = mount(source, target, "bind", MS_BIND | MS_REC | mnt_opts->mnt_flags | mnt_opts->prop_flags, mnt_opts->data);
                if (ret < 0)
@@ -192,6 +190,8 @@ int dir_mount(struct lxc_storage *bdev)
                TRACE("Mounted \"%s\" on \"%s\" with options \"%s\", mount flags \"%lu\", and propagation flags \"%lu\"",
                      source, target, mnt_opts->data, mflags, mnt_opts->mnt_flags);
        }
+       if (ret < 0)
+               return syserror_set(ret, "Failed to mount \"%s\" onto \"%s\"", source, target);
 
        TRACE("Mounted \"%s\" onto \"%s\"", source, target);
        return 0;