Re: [PATCH 3/3] nvme-core: fix crash when nvme_enable_aen timeout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




-static void nvme_enable_aen(struct nvme_ctrl *ctrl)
+static int nvme_enable_aen(struct nvme_ctrl *ctrl)
   {
       u32 result, supported_aens = ctrl->oaes & NVME_AEN_SUPPORTED;
       int status;
       if (!supported_aens)
-        return;
+        return 0;
       status = nvme_set_features(ctrl, NVME_FEAT_ASYNC_EVENT, supported_aens,
               NULL, 0, &result);
-    if (status)
+    if (status) {
           dev_warn(ctrl->device, "Failed to configure AEN (cfg %x)\n",
                supported_aens);
+        if (status < 0)
+            return status;

Why do you need to check status < 0, you need to fail it regardless.

agree.
Just want to keep the old logic. I guess the old logic: if supported_aens
is true, the result of set features can ignore.

If there is no objection to doing so, I will resend the patch later.

In the past we've dedice to ignore real NVMe errors in various
spots as the functionality wasn't deemed critical.  I think that is
pretty sloppy and we should only do that where we really have to.

Agreed.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux