Linux CIFS filesystem development
 help / color / mirror / Atom feed
* blocking write() after disconnecting cifs server
@ 2013-12-03 13:16 mail654-Mmb7MZpHnFY
  2013-12-23 10:46 ` Jeff Layton
  0 siblings, 1 reply; 7+ messages in thread
From: mail654-Mmb7MZpHnFY @ 2013-12-03 13:16 UTC (permalink / raw)
  To: linux-cifs-u79uwXL29TY76Z2rM5mHXA

Hello,

write() from cifs kernel driver blocks when disconnecting the cifs server. The blocking call didn't return after 30 minutes. Client and server are connected via a switch and server's LAN cable is unplugged during the write call. I use kernel 3.11.8 and mounted without "hard" option.

Is there a possibility for an non-blocking write() without using O_SYNC or "directio" mount option?

Way to reproduce the scenario: Below is a sample program which calls write() in a loop. The error messages appear when unplugging the cable during this loop.

Kind regards,
Hagen

CIFS VFS: sends on sock ffff88003710c280 stuck for 15 seconds
CIFS VFS: Error -11 sending data on socket to server

#include <fstream>
#include <iostream>
int main () {
  const int size = 100000;
  char buffer[size];
  std::ofstream outfile("/mnt/new.bin",std::ofstream::binary);
  if (!outfile.is_open())
  {
    return 1;
  }
  for (int idx=0; idx<10000 && outfile.good(); idx++)
  {
    outfile.write(buffer,size);
    std::cout << "written, size=" << size << std::endl;
  }
  std::cout << "finished " << outfile.good() << std::endl;
  outfile.close();
  return 0;
}

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-01-20 12:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-03 13:16 blocking write() after disconnecting cifs server mail654-Mmb7MZpHnFY
2013-12-23 10:46 ` Jeff Layton
     [not found]   ` <trinity-2ffa0afb-c02b-46c6-9e2e-31b209aebd8b-1388678667254@3capp-gmx-bs34>
2014-01-02 19:31     ` Jeff Layton
     [not found]       ` <20140102143157.3232068c-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2014-01-03  9:10         ` Aw: " mail654-Mmb7MZpHnFY
2014-01-11  2:45         ` Shirish Pargaonkar
2014-01-19  4:40         ` Shirish Pargaonkar
     [not found]           ` <CADT32eLOnvVO3phJTqC7TATdJuhgUXgxvAVvDZS+kmDDr-MmiA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-01-20 12:40             ` Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox