old_ip = NULL;
if (r == EENTERMOUNT) r = EXDEV; /* should this fail at all? */
else if (r == ELEAVEMOUNT) r = EINVAL; /* rename on dot-dot */
+ } else if (old_ip == NULL) {
+ return(err_code);
}
/* Get new dir inode */
- if( (new_dirp = get_inode(fs_dev, (ino_t) fs_m_in.REQ_REN_NEW_DIR)) == NULL)
- r = err_code;
- else {
+ if( (new_dirp = get_inode(fs_dev, (ino_t) fs_m_in.REQ_REN_NEW_DIR)) == NULL) {
+ put_inode(old_ip);
+ put_inode(old_dirp);
+ return(err_code);
+ } else {
if (new_dirp->i_nlinks == NO_LINK) { /* Dir does not actually exist */
put_inode(old_ip);
put_inode(old_dirp);
* three major activities: getting new work, processing the work, and
* sending the reply. The loop never terminates, unless a panic occurs.
*/
- int error, ind, transid;
+ int error = OK, ind, transid;
/* SEF local startup. */
env_setargs(argc, argv);
assert(IS_VFS_FS_TRANSID(transid));
src = fs_m_in.m_source;
- error = OK;
caller_uid = INVAL_UID; /* To trap errors */
caller_gid = INVAL_GID;
req_nr = fs_m_in.m_type;
block = baseblock;
bp = get_block(dev, block, PREFETCH);
+ assert(bp != NULL);
if (bp->b_dev != NO_DEV) return(bp);
/* The best guess for the number of blocks to prefetch: A lot.
bit_t i, b;
bit_t free_bits;
+ assert(sp != NULL);
+
if (map == IMAP) {
start_block = START_BLOCK;
map_bits = (bit_t) (sp->s_ninodes + 1);
excess = excess % nr_indirects;
if (ind_ex >= nr_indirects) return(EFBIG);
- if(z == NO_ZONE) {
+ if(z == NO_ZONE && (op & WMAP_FREE)) {
/* WMAP_FREE and no double indirect block - then no
* single indirect block either.
*/