Merge branch 'for-4.15/block' of git://git.kernel.dk/linux-block
[linux-2.6-microblaze.git] / drivers / md / bcache / closure.h
index 965907c..ccfbea6 100644 (file)
@@ -252,6 +252,12 @@ static inline void set_closure_fn(struct closure *cl, closure_fn *fn,
 static inline void closure_queue(struct closure *cl)
 {
        struct workqueue_struct *wq = cl->wq;
+       /**
+        * Changes made to closure, work_struct, or a couple of other structs
+        * may cause work.func not pointing to the right location.
+        */
+       BUILD_BUG_ON(offsetof(struct closure, fn)
+                    != offsetof(struct work_struct, func));
        if (wq) {
                INIT_WORK(&cl->work, cl->work.func);
                BUG_ON(!queue_work(wq, &cl->work));