diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-09-12 01:29:55 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1997-09-12 01:29:55 +0000 |
commit | 545f435ebcfd94a1e7c20b46efe81b4d6ac4e698 (patch) | |
tree | e9ce4bc598d06374bda906f18365984bf22a526a /mm/filemap.c | |
parent | 4291a610eef89d0d5c69d9a10ee6560e1aa36c74 (diff) |
Merge with Linux 2.1.55. More bugfixes and goodies from my private
CVS archive.
Diffstat (limited to 'mm/filemap.c')
-rw-r--r-- | mm/filemap.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index 03e82469e..e6e4cd424 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -894,8 +894,9 @@ no_page: static inline int do_write_page(struct inode * inode, struct file * file, const char * page, unsigned long offset) { - int old_fs, retval; + int retval; unsigned long size; + unsigned long old_fs; size = offset + PAGE_SIZE; /* refuse to extend file size.. */ @@ -954,11 +955,14 @@ static int filemap_write_page(struct vm_area_struct * vma, file.f_reada = 0; /* - * WSH: could vm_area struct (and inode) be released while writing? + * If a task terminates while we're swapping the page, the vma and + * and dentry could be released ... increment the count to be safe. */ + dget(dentry); down(&inode->i_sem); result = do_write_page(inode, &file, (const char *) page, offset); up(&inode->i_sem); + dput(dentry); return result; } |