Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
c707ea8c
Commit
c707ea8c
authored
Apr 22, 2003
by
Steve French
Committed by
Steve French
Apr 22, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix hang in truncate setting file size
parent
7ad16251
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
12 deletions
+41
-12
fs/cifs/CHANGES
fs/cifs/CHANGES
+4
-0
fs/cifs/cifssmb.c
fs/cifs/cifssmb.c
+11
-11
fs/cifs/inode.c
fs/cifs/inode.c
+26
-1
No files found.
fs/cifs/CHANGES
View file @
c707ea8c
Version 0.74
------------
Fix truncate bug (set file size) that could cause hangs e.g. running fsx
Version 0.73
Version 0.73
------------
------------
unload nls if mount fails.
unload nls if mount fails.
...
...
fs/cifs/cifssmb.c
View file @
c707ea8c
fs/cifs/inode.c
View file @
c707ea8c
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include <linux/fs.h>
#include <linux/fs.h>
#include <linux/buffer_head.h>
#include <linux/buffer_head.h>
#include <linux/stat.h>
#include <linux/stat.h>
#include <linux/pagemap.h>
#include <asm/div64.h>
#include <asm/div64.h>
#include "cifsfs.h"
#include "cifsfs.h"
#include "cifspdu.h"
#include "cifspdu.h"
...
@@ -587,6 +588,29 @@ cifs_truncate_file(struct inode *inode)
...
@@ -587,6 +588,29 @@ cifs_truncate_file(struct inode *inode)
return
;
return
;
}
}
static
int
cifs_trunc_page
(
struct
address_space
*
mapping
,
loff_t
from
)
{
pgoff_t
index
=
from
>>
PAGE_CACHE_SHIFT
;
unsigned
offset
=
from
&
(
PAGE_CACHE_SIZE
-
1
);
struct
page
*
page
;
char
*
kaddr
;
int
rc
=
0
;
page
=
grab_cache_page
(
mapping
,
index
);
if
(
!
page
)
return
-
ENOMEM
;
kaddr
=
kmap_atomic
(
page
,
KM_USER0
);
memset
(
kaddr
+
offset
,
0
,
PAGE_CACHE_SIZE
-
offset
);
flush_dcache_page
(
page
);
kunmap_atomic
(
kaddr
,
KM_USER0
);
set_page_dirty
(
page
);
unlock_page
(
page
);
page_cache_release
(
page
);
return
rc
;
}
int
int
cifs_setattr
(
struct
dentry
*
direntry
,
struct
iattr
*
attrs
)
cifs_setattr
(
struct
dentry
*
direntry
,
struct
iattr
*
attrs
)
{
{
...
@@ -639,7 +663,8 @@ cifs_setattr(struct dentry *direntry, struct iattr *attrs)
...
@@ -639,7 +663,8 @@ cifs_setattr(struct dentry *direntry, struct iattr *attrs)
/* CIFSSMBSetEOF(xid, pTcon, full_path, attrs->ia_size, TRUE, cifs_sb->local_nls);*/
/* CIFSSMBSetEOF(xid, pTcon, full_path, attrs->ia_size, TRUE, cifs_sb->local_nls);*/
if
(
rc
==
0
)
{
if
(
rc
==
0
)
{
rc
=
vmtruncate
(
direntry
->
d_inode
,
attrs
->
ia_size
);
rc
=
vmtruncate
(
direntry
->
d_inode
,
attrs
->
ia_size
);
nobh_truncate_page
(
direntry
->
d_inode
->
i_mapping
,
direntry
->
d_inode
->
i_size
);
cifs_trunc_page
(
direntry
->
d_inode
->
i_mapping
,
direntry
->
d_inode
->
i_size
);
/* cFYI(1,("truncate_page to 0x%lx \n",direntry->d_inode->i_size)); */
/* cFYI(1,("truncate_page to 0x%lx \n",direntry->d_inode->i_size)); */
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment