|
From: Andy P. <at...@us...> - 2002-04-09 15:09:00
|
Update of /cvsroot/linux-vax/kernel-2.4/fs/hpfs
In directory usw-pr-cvs1:/tmp/cvs-serv27691/hpfs
Modified Files:
anode.c dir.c file.c inode.c super.c
Log Message:
sync 2.4.15 commit 11
Index: anode.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/fs/hpfs/anode.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- anode.c 14 Jan 2001 16:27:34 -0000 1.1.1.1
+++ anode.c 9 Apr 2002 13:11:18 -0000 1.2
@@ -161,6 +161,7 @@
if ((a == node && fnod) || na == -1) return se;
c2 = 0;
while (up != -1) {
+ struct anode *new_anode;
if (s->s_hpfs_chk)
if (hpfs_stop_cycles(s, up, &c1, &c2, "hpfs_add_sector_to_btree #2")) return -1;
if (up != node || !fnod) {
@@ -194,7 +195,8 @@
mark_buffer_dirty(bh);
brelse(bh);
a = na;
- if ((anode = hpfs_alloc_anode(s, a, &na, &bh))) {
+ if ((new_anode = hpfs_alloc_anode(s, a, &na, &bh))) {
+ anode = new_anode;
/*anode->up = up != -1 ? up : ra;*/
anode->btree.internal = 1;
anode->btree.n_used_nodes = 1;
@@ -282,7 +284,7 @@
if (s->s_hpfs_chk)
if (hpfs_stop_cycles(s, ano, &d1, &d2, "hpfs_remove_btree #1"))
return;
- anode = hpfs_map_anode(s, ano, &bh);
+ if (!(anode = hpfs_map_anode(s, ano, &bh))) return;
btree1 = &anode->btree;
level++;
pos = 0;
@@ -291,14 +293,14 @@
hpfs_free_sectors(s, btree1->u.external[i].disk_secno, btree1->u.external[i].length);
go_up:
if (!level) return;
+ brelse(bh);
if (s->s_hpfs_chk)
if (hpfs_stop_cycles(s, ano, &c1, &c2, "hpfs_remove_btree #2")) return;
- brelse(bh);
hpfs_free_sectors(s, ano, 1);
oano = ano;
ano = anode->up;
if (--level) {
- anode = hpfs_map_anode(s, ano, &bh);
+ if (!(anode = hpfs_map_anode(s, ano, &bh))) return;
btree1 = &anode->btree;
} else btree1 = btree;
for (i = 0; i < btree1->n_used_nodes; i++) {
Index: dir.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/fs/hpfs/dir.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- dir.c 14 Jan 2001 16:27:36 -0000 1.1.1.1
+++ dir.c 9 Apr 2002 13:11:18 -0000 1.2
@@ -212,7 +212,7 @@
hpfs_lock_iget(dir->i_sb, de->directory || (de->ea_size && dir->i_sb->s_hpfs_eas) ? 1 : 2);
if (!(result = iget(dir->i_sb, ino))) {
hpfs_unlock_iget(dir->i_sb);
- hpfs_error(result->i_sb, "hpfs_lookup: can't get inode");
+ hpfs_error(dir->i_sb, "hpfs_lookup: can't get inode");
goto bail1;
}
if (!de->directory) result->i_hpfs_parent_dir = dir->i_ino;
Index: file.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/fs/hpfs/file.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- file.c 14 Jan 2001 16:27:42 -0000 1.1.1.1
+++ file.c 9 Apr 2002 13:11:18 -0000 1.2
@@ -11,6 +11,8 @@
#include <linux/smp_lock.h>
#include "hpfs_fn.h"
+#define BLOCKS(size) (((size) + 511) >> 9)
+
/* HUH? */
int hpfs_open(struct inode *i, struct file *f)
{
@@ -46,7 +48,7 @@
unsigned n, disk_secno;
struct fnode *fnode;
struct buffer_head *bh;
- if (((inode->i_size + 511) >> 9) <= file_secno) return 0;
+ if (BLOCKS(inode->u.hpfs_i.mmu_private) <= file_secno) return 0;
n = file_secno - inode->i_hpfs_file_sec;
if (n < inode->i_hpfs_n_secs) return inode->i_hpfs_disk_sec + n;
if (!(fnode = hpfs_map_fnode(inode->i_sb, inode->i_ino, &bh))) return 0;
Index: inode.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/fs/hpfs/inode.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- inode.c 25 Feb 2001 23:14:46 -0000 1.1.1.2
+++ inode.c 9 Apr 2002 13:11:18 -0000 1.2
@@ -12,6 +12,7 @@
static struct file_operations hpfs_file_ops =
{
+ llseek: generic_file_llseek,
read: generic_file_read,
write: hpfs_file_write,
mmap: generic_file_mmap,
@@ -299,10 +300,12 @@
{
struct inode *inode = dentry->d_inode;
int error;
- if ((attr->ia_valid & ATTR_SIZE) && attr->ia_size > inode->i_size) return -EINVAL;
+ if ((attr->ia_valid & ATTR_SIZE) && attr->ia_size > inode->i_size)
+ return -EINVAL;
if (inode->i_sb->s_hpfs_root == inode->i_ino) return -EINVAL;
if ((error = inode_change_ok(inode, attr))) return error;
- inode_setattr(inode, attr);
+ error = inode_setattr(inode, attr);
+ if (error) return error;
hpfs_write_inode(inode);
return 0;
}
Index: super.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/fs/hpfs/super.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- super.c 14 Jan 2001 16:27:44 -0000 1.1.1.1
+++ super.c 9 Apr 2002 13:11:18 -0000 1.2
@@ -212,6 +212,8 @@
return 0;
}
else if (!strcmp(p, "case")) {
+ if (!rhs || !*rhs)
+ return 0;
if (!strcmp(rhs, "lower"))
*lowercase = 1;
else if (!strcmp(rhs, "asis"))
@@ -220,6 +222,8 @@
return 0;
}
else if (!strcmp(p, "conv")) {
+ if (!rhs || !*rhs)
+ return 0;
if (!strcmp(rhs, "binary"))
*conv = CONV_BINARY;
else if (!strcmp(rhs, "text"))
@@ -230,6 +234,8 @@
return 0;
}
else if (!strcmp(p, "check")) {
+ if (!rhs || !*rhs)
+ return 0;
if (!strcmp(rhs, "none"))
*chk = 0;
else if (!strcmp(rhs, "normal"))
@@ -240,6 +246,8 @@
return 0;
}
else if (!strcmp(p, "errors")) {
+ if (!rhs || !*rhs)
+ return 0;
if (!strcmp(rhs, "continue"))
*errs = 0;
else if (!strcmp(rhs, "remount-ro"))
@@ -250,6 +258,8 @@
return 0;
}
else if (!strcmp(p, "eas")) {
+ if (!rhs || !*rhs)
+ return 0;
if (!strcmp(rhs, "no"))
*eas = 0;
else if (!strcmp(rhs, "ro"))
@@ -260,6 +270,8 @@
return 0;
}
else if (!strcmp(p, "chkdsk")) {
+ if (!rhs || !*rhs)
+ return 0;
if (!strcmp(rhs, "no"))
*chkdsk = 0;
else if (!strcmp(rhs, "errors"))
|