Commit 789ac4bb authored by Eric Sandeen's avatar Eric Sandeen Committed by Christoph Hellwig

XFS: add error checks to linvfs_direct_IO

Date:  Wed Sep 11 12:12:31 PDT 2002
Workarea:  stout.americas.sgi.com:/localhome/src/sandeen/2.5.x-xfs/workarea
Merged by:  sandeen
Merged mods:  
2.4.x-xfs:slinx:127120a
2.4.x-xfs:slinx:127147a
Author:  sandeen

The following file(s) were checked into:
  bonnie.engr.sgi.com:/isms/slinx/2.5.x-xfs


Modid:  2.5.x-xfs:slinx:127150a
linux/fs/xfs/linux/xfs_iops.c - 1.180
	- Merge of 2.4.x-xfs:slinx:127120a originally by sandeen on 09/11/02

linux/fs/xfs/linux/xfs_aops.c - 1.4
	- Merge of 2.4.x-xfs:slinx:127147a originally by sandeen on 09/11/02
	  add error checks to linvfs_direct_IO
parent 83cbc1c2
...@@ -879,17 +879,25 @@ linvfs_direct_IO( ...@@ -879,17 +879,25 @@ linvfs_direct_IO(
pg_count = (size + page_offset + PAGE_CACHE_SIZE - 1) pg_count = (size + page_offset + PAGE_CACHE_SIZE - 1)
>> PAGE_CACHE_SHIFT; >> PAGE_CACHE_SHIFT;
pb = pagebuf_lookup(map.pbm_target, inode, offset, if ((pb = pagebuf_lookup(map.pbm_target, inode, offset,
size, pb_flags); size, pb_flags)) == NULL) {
error = -ENOMEM;
break;
}
/* Need to hook up pagebuf to kiobuf pages */ /* Need to hook up pagebuf to kiobuf pages */
pb->pb_pages = &maplist[pg_index]; pb->pb_pages = &maplist[pg_index];
pb->pb_offset = page_offset; pb->pb_offset = page_offset;
pb->pb_page_count = pg_count; pb->pb_page_count = pg_count;
pb->pb_bn = map.pbm_bn + (map.pbm_delta >> 9); pb->pb_bn = map.pbm_bn + (map.pbm_delta >> 9);
pagebuf_iostart(pb, pb_flags); error = pagebuf_iostart(pb, pb_flags);
pb->pb_flags &= ~_PBF_LOCKABLE; pb->pb_flags &= ~_PBF_LOCKABLE;
pagebuf_rele(pb); pagebuf_rele(pb);
if (error != 0) {
if (error > 0)
error = -error;
break;
}
page_offset = (page_offset + size) & ~PAGE_CACHE_MASK; page_offset = (page_offset + size) & ~PAGE_CACHE_MASK;
if (page_offset) if (page_offset)
...@@ -901,7 +909,7 @@ linvfs_direct_IO( ...@@ -901,7 +909,7 @@ linvfs_direct_IO(
length -= size; length -= size;
} }
return error ? error : total - length; return (error ? error : (int)(total - length));
} }
#endif #endif
......
...@@ -264,7 +264,7 @@ linvfs_symlink( ...@@ -264,7 +264,7 @@ linvfs_symlink(
bzero(&va, sizeof(va)); bzero(&va, sizeof(va));
va.va_type = VLNK; va.va_type = VLNK;
va.va_mode = S_IRWXUGO; va.va_mode = 0777 & ~current->fs->umask;
va.va_mask = AT_TYPE|AT_MODE; /* AT_PROJID? */ va.va_mask = AT_TYPE|AT_MODE; /* AT_PROJID? */
error = 0; error = 0;
......
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