Whamcloud - gitweb
LU-12616 obclass: fix MDS start/stop race
[fs/lustre-release.git] / lustre / osc / osc_request.c
index 44c7ad1..b0ff640 100644 (file)
@@ -902,12 +902,13 @@ static void osc_grant_work_handler(struct work_struct *data)
        if (client_gtd.gtd_stopped == 1)
                return;
 
-       if (next_shrink > ktime_get_seconds())
-               schedule_delayed_work(&work, msecs_to_jiffies(
-                                       (next_shrink - ktime_get_seconds()) *
-                                       MSEC_PER_SEC));
-       else
+       if (next_shrink > ktime_get_seconds()) {
+               time64_t delay = next_shrink - ktime_get_seconds();
+
+               schedule_delayed_work(&work, cfs_time_seconds(delay));
+       } else {
                schedule_work(&work.work);
+       }
 }
 
 void osc_schedule_grant_work(void)
@@ -1068,8 +1069,11 @@ static int check_write_rcs(struct ptlrpc_request *req,
 
         /* return error if any niobuf was in error */
         for (i = 0; i < niocount; i++) {
-                if ((int)remote_rcs[i] < 0)
-                        return(remote_rcs[i]);
+               if ((int)remote_rcs[i] < 0) {
+                       CDEBUG(D_INFO, "rc[%d]: %d req %p\n",
+                              i, remote_rcs[i], req);
+                       return remote_rcs[i];
+               }
 
                 if (remote_rcs[i] != 0) {
                         CDEBUG(D_INFO, "rc[%d] invalid (%d) req %p\n",
@@ -1624,7 +1628,7 @@ static void dump_all_bulk_pages(struct obdo *oa, __u32 page_count,
                kunmap(pga[i]->pg);
        }
 
-       rc = ll_vfs_fsync_range(filp, 0, LLONG_MAX, 1);
+       rc = vfs_fsync_range(filp, 0, LLONG_MAX, 1);
        if (rc)
                CERROR("%s: sync returns %d\n", dbgcksum_file_name, rc);
        filp_close(filp, NULL);
@@ -3392,8 +3396,6 @@ static int osc_cache_shrink(SHRINKER_ARGS(sc, nr_to_scan, gfp_mask))
 
 static int __init osc_init(void)
 {
-       bool enable_proc = true;
-       struct obd_type *type;
        unsigned int reqpool_size;
        unsigned int reqsize;
        int rc;
@@ -3410,11 +3412,7 @@ static int __init osc_init(void)
        if (rc)
                RETURN(rc);
 
-       type = class_search_type(LUSTRE_OSP_NAME);
-       if (type != NULL && type->typ_procsym != NULL)
-               enable_proc = false;
-
-       rc = class_register_type(&osc_obd_ops, NULL, enable_proc, NULL,
+       rc = class_register_type(&osc_obd_ops, NULL, true, NULL,
                                 LUSTRE_OSC_NAME, &osc_device_type);
        if (rc)
                GOTO(out_kmem, rc);