Commit dc3d70e8 authored by Steve French's avatar Steve French Committed by Steve French

fix ppc64 build problem due to missing header

parent 6bc73d8e
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/ipv6.h> #include <linux/ipv6.h>
#include <linux/pagemap.h> #include <linux/pagemap.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/utsname.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/processor.h> #include <asm/processor.h>
#include "cifspdu.h" #include "cifspdu.h"
......
...@@ -561,6 +561,10 @@ cifs_write(struct file * file, const char *write_data, ...@@ -561,6 +561,10 @@ cifs_write(struct file * file, const char *write_data,
} }
open_file = (struct cifsFileInfo *) file->private_data; open_file = (struct cifsFileInfo *) file->private_data;
if(file->f_dentry->d_inode == NULL) {
FreeXid(xid);
return -EBADF;
}
if (*poffset > file->f_dentry->d_inode->i_size) if (*poffset > file->f_dentry->d_inode->i_size)
long_op = 2; /* writes past end of file can take a long time */ long_op = 2; /* writes past end of file can take a long time */
...@@ -571,7 +575,16 @@ cifs_write(struct file * file, const char *write_data, ...@@ -571,7 +575,16 @@ cifs_write(struct file * file, const char *write_data,
total_written += bytes_written) { total_written += bytes_written) {
rc = -EAGAIN; rc = -EAGAIN;
while(rc == -EAGAIN) { while(rc == -EAGAIN) {
if(file->private_data == NULL) {
/* file has been closed on us */
FreeXid(xid);
return total_written;
}
if ((open_file->invalidHandle) && (!open_file->closePend)) { if ((open_file->invalidHandle) && (!open_file->closePend)) {
if((file->f_dentry == NULL) || (file->f_dentry->d_inode == NULL)) {
FreeXid(xid);
return total_written;
}
rc = cifs_reopen_file(file->f_dentry->d_inode,file); rc = cifs_reopen_file(file->f_dentry->d_inode,file);
if(rc != 0) if(rc != 0)
break; break;
...@@ -594,6 +607,10 @@ cifs_write(struct file * file, const char *write_data, ...@@ -594,6 +607,10 @@ cifs_write(struct file * file, const char *write_data,
*poffset += bytes_written; *poffset += bytes_written;
long_op = FALSE; /* subsequent writes fast - 15 seconds is plenty */ long_op = FALSE; /* subsequent writes fast - 15 seconds is plenty */
} }
/* since the write may have blocked check these pointers again */
if(file->f_dentry) {
if(file->f_dentry->d_inode) {
file->f_dentry->d_inode->i_ctime = file->f_dentry->d_inode->i_mtime = file->f_dentry->d_inode->i_ctime = file->f_dentry->d_inode->i_mtime =
CURRENT_TIME; CURRENT_TIME;
if (bytes_written > 0) { if (bytes_written > 0) {
...@@ -601,6 +618,8 @@ cifs_write(struct file * file, const char *write_data, ...@@ -601,6 +618,8 @@ cifs_write(struct file * file, const char *write_data,
i_size_write(file->f_dentry->d_inode, *poffset); i_size_write(file->f_dentry->d_inode, *poffset);
} }
mark_inode_dirty_sync(file->f_dentry->d_inode); mark_inode_dirty_sync(file->f_dentry->d_inode);
}
}
FreeXid(xid); FreeXid(xid);
return total_written; return total_written;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment