blocklayout destruction and device id cache on error

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

 



Hi all,

For SCSI devices, the last placement of the device is going to try to
unregister the client's SCSI reservation, and this process allocates memory
somewhere in the sg code and might sleep.  Usually, that's no problem as the
last placement is the client's which is done when the the nfs4_server is
destroyed.

However, a session error can cause the client to purge the client's devices
and then destroy layouts, which means that for blocklayouts we will do the
final put of the device under a spinlock in ext_tree_remove() which is part
of the accounting bits for determining which page IO belongs to which
device, and it might sleep holding that lock.

A really lazy way to fix this would be to destroy the layouts before
purging the client's devices, like:

 pnfs_destroy_all_layouts(struct nfs_client *clp)
 {
        nfs4_deviceid_mark_client_invalid(clp);
-       nfs4_deviceid_purge_client(clp);

        pnfs_destroy_layouts_byclid(clp, false);
+       nfs4_deviceid_purge_client(clp);
 }

.. but, I am not sure if that poses a problem for any of the other layout
types.

It could be argued that if we can't ever do the final placement from
ext_tree_remove(), why should we bother to reference the device from there
in the first place?

Any thoughts?

Ben
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux