staging/lustre/mdc: Keep resend FLocks
authorBruno Faccini <bruno.faccini@intel.com>
Mon, 22 Jul 2013 16:07:09 +0000 (00:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jul 2013 20:45:09 +0000 (13:45 -0700)
FLocks requests (particulary F_UNLCKs) can't be trashed
upon comm problems with Server/MDS nor upon kill/exit,
thus we need to keep retry/send.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2665
Lustre-change: http://review.whamcloud.com/6415
Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/mdc/mdc_locks.c

index ab88a46c1a2751aa5e9378ed51ce13ab6c10a348..803c390e1c35d628c9f6c23ca181f243e635583c 100644 (file)
@@ -823,7 +823,13 @@ resend:
                /* For flock requests we immediatelly return without further
                   delay and let caller deal with the rest, since rest of
                   this function metadata processing makes no sense for flock
-                  requests anyway */
+                  requests anyway. But in case of problem during comms with
+                  Server (ETIMEDOUT) or any signal/kill attempt (EINTR), we
+                  can not rely on caller and this mainly for F_UNLCKs
+                  (explicits or automatically generated by Kernel to clean
+                  current FLocks upon exit) that can't be trashed */
+               if ((rc == -EINTR) || (rc == -ETIMEDOUT))
+                       goto resend;
                RETURN(rc);
        }