|
@@ -2034,7 +2034,6 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
|
|
|
struct tcon_link *tlink = NULL;
|
|
|
struct cifs_tcon *tcon = NULL;
|
|
|
struct TCP_Server_Info *server;
|
|
|
- struct cifs_io_parms io_parms;
|
|
|
|
|
|
/*
|
|
|
* To avoid spurious oplock breaks from server, in the case of
|
|
@@ -2056,18 +2055,6 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
|
|
|
rc = -ENOSYS;
|
|
|
cifsFileInfo_put(open_file);
|
|
|
cifs_dbg(FYI, "SetFSize for attrs rc = %d\n", rc);
|
|
|
- if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
|
|
|
- unsigned int bytes_written;
|
|
|
-
|
|
|
- io_parms.netfid = open_file->fid.netfid;
|
|
|
- io_parms.pid = open_file->pid;
|
|
|
- io_parms.tcon = tcon;
|
|
|
- io_parms.offset = 0;
|
|
|
- io_parms.length = attrs->ia_size;
|
|
|
- rc = CIFSSMBWrite(xid, &io_parms, &bytes_written,
|
|
|
- NULL, NULL, 1);
|
|
|
- cifs_dbg(FYI, "Wrt seteof rc %d\n", rc);
|
|
|
- }
|
|
|
} else
|
|
|
rc = -EINVAL;
|
|
|
|
|
@@ -2093,28 +2080,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
|
|
|
else
|
|
|
rc = -ENOSYS;
|
|
|
cifs_dbg(FYI, "SetEOF by path (setattrs) rc = %d\n", rc);
|
|
|
- if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
|
|
|
- __u16 netfid;
|
|
|
- int oplock = 0;
|
|
|
|
|
|
- rc = SMBLegacyOpen(xid, tcon, full_path, FILE_OPEN,
|
|
|
- GENERIC_WRITE, CREATE_NOT_DIR, &netfid,
|
|
|
- &oplock, NULL, cifs_sb->local_nls,
|
|
|
- cifs_remap(cifs_sb));
|
|
|
- if (rc == 0) {
|
|
|
- unsigned int bytes_written;
|
|
|
-
|
|
|
- io_parms.netfid = netfid;
|
|
|
- io_parms.pid = current->tgid;
|
|
|
- io_parms.tcon = tcon;
|
|
|
- io_parms.offset = 0;
|
|
|
- io_parms.length = attrs->ia_size;
|
|
|
- rc = CIFSSMBWrite(xid, &io_parms, &bytes_written, NULL,
|
|
|
- NULL, 1);
|
|
|
- cifs_dbg(FYI, "wrt seteof rc %d\n", rc);
|
|
|
- CIFSSMBClose(xid, tcon, netfid);
|
|
|
- }
|
|
|
- }
|
|
|
if (tlink)
|
|
|
cifs_put_tlink(tlink);
|
|
|
|