On Mon, 27 Dec 2010 19:20:05 +0300 Pavel Shilovsky <piastryyy@xxxxxxxxx> wrote: > 2010/12/27 Jeff Layton <jlayton@xxxxxxxxxx>: > > On Sun, 26 Dec 2010 13:04:18 +0300 > > Pavel Shilovsky <piastryyy@xxxxxxxxx> wrote: > > > >> If we don't have Exclusive oplock we write a data to the server. > >> Also set invalidate_mapping flag on the inode if we wrote something > >> to the server. Add cifs_iovec_write to let the client write iovec > >> buffers through CIFSSMBWrite2. > >> > >> Signed-off-by: Pavel Shilovsky <piastryyy@xxxxxxxxx> > >> --- > >> fs/cifs/cifsfs.c | 15 +++- > >> fs/cifs/cifsfs.h | 6 ++- > >> fs/cifs/cifsproto.h | 2 + > >> fs/cifs/file.c | 193 ++++++++++++++++++++++++++++++++++++++++++++++++++- > >> 4 files changed, 210 insertions(+), 6 deletions(-) > >> > >> diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c > >> index 0d6b005..76ba04e 100644 [...] > >> + > >> + do { > >> + rc = CIFSSMBWrite2(xid, pTcon, open_file->netfid, > >> + cur_len, *poffset, &written, > >> + to_send, npages, 0); > >> + } while (rc == -EAGAIN); > >> + > > ^^^^^^^^^^^^^ > > I think the above loop needs to be able to reclaim the filehandle if > > there was a reconnect event. > > May I should add both checks: file->private_data == NULL and > open_file->invalidHandle like we have them here > -http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/fs/cifs/file.c#L963 ? > A private_data of NULL on an open file is now a bug. Directories can currently have a NULL private_data, but that shouldn't be a problem here. I'd just check for invalidHandle. CIFS also has a ton of unneeded NULL pointer checks so it's not always worthwhile to use existing code as a guideline. -- Jeff Layton <jlayton@xxxxxxxxxx> -- To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html