if (IS_ERR(lower_file)) {
err = PTR_ERR(lower_file);
goto out;
- } else
+ } else {
unionfs_set_lower_file_idx(file, bindex, lower_file);
+ }
}
out:
return err;
break;
}
return err;
- } else
+ } else {
lower_flags &= ~(OPEN_WRITE_FLAGS);
+ }
}
dget(lower_dentry);
* always be valid, but its lower inode times don't have to
* be, so sync up the times only.
*/
- if (IS_ROOT(dtmp))
+ if (IS_ROOT(dtmp)) {
unionfs_copy_attr_times(dtmp->d_inode);
- else {
+ } else {
/*
* reset generation number to zero, guaranteed to be
* "old"
if (unlikely(is_newer_lower(dentry))) {
/* root dentry special case as aforementioned */
- if (IS_ROOT(dentry))
+ if (IS_ROOT(dentry)) {
unionfs_copy_attr_times(dentry->d_inode);
- else {
+ } else {
/*
* reset generation number to zero, guaranteed to be
* "old"
free_rdstate(uds);
UNIONFS_F(file)->rdstate = NULL;
file->f_pos = DIREOF;
- } else
+ } else {
file->f_pos = rdstate2offset(uds);
+ }
out:
unionfs_read_unlock(file->f_path.dentry->d_sb);
if (rdstate) {
UNIONFS_F(file)->rdstate = rdstate;
err = rdstate->offset;
- } else
+ } else {
err = -EINVAL;
+ }
}
break;
case SEEK_CUR:
BUG_ON(!S_ISDIR(lower_dir->i_mode));
mutex_lock(&lower_dir->i_mutex);
- if (!permission(lower_dir, MAY_WRITE | MAY_EXEC, NULL))
+ if (!permission(lower_dir, MAY_WRITE | MAY_EXEC, NULL)) {
err = do_delete_whiteouts(dentry, bindex, namelist);
- else {
+ } else {
args.deletewh.namelist = namelist;
args.deletewh.dentry = dentry;
args.deletewh.bindex = bindex;
if (!IS_COPYUP_ERR(err))
goto out;
bstart--;
- } else
+ } else {
whiteout_unlinked = 1;
+ }
}
for (bindex = bstart; bindex >= 0; bindex--) {
if (!IS_COPYUP_ERR(err))
goto out;
bstart--;
- } else
+ } else {
whiteout_unlinked = 1;
+ }
}
for (bindex = bstart; bindex >= 0; bindex--) {
mutex_lock(&lower_inode->i_mutex);
- if (!permission(lower_inode, MAY_EXEC, NULL))
+ if (!permission(lower_inode, MAY_EXEC, NULL)) {
wh_lower_dentry =
lookup_one_len(UNIONFS_DIR_OPAQUE, lower_dentry,
sizeof(UNIONFS_DIR_OPAQUE) - 1);
- else {
+ } else {
args.is_opaque.dentry = lower_dentry;
run_sioq(__is_opaque_dir, &args);
wh_lower_dentry = args.ret;
first_lower_mnt =
unionfs_mntget(parent_dentry, bindex);
first_dentry_offset = bindex;
- } else
+ } else {
dput(lower_dentry);
+ }
continue;
}
break;
case INTERPOSE_LOOKUP:
spliced = d_splice_alias(inode, dentry);
- if (IS_ERR(spliced))
+ if (IS_ERR(spliced)) {
err = PTR_ERR(spliced);
- else if (spliced && spliced != dentry) {
+ } else if (spliced && spliced != dentry) {
/*
* d_splice can return a dentry if it was
* disconnected and had to be moved. We must ensure
new->bindex = bindex;
new->whiteout = whiteout;
- if (namelen < DNAME_INLINE_LEN_MIN)
+ if (namelen < DNAME_INLINE_LEN_MIN) {
new->name = new->iname;
- else {
+ } else {
new->name = kmalloc(namelen + 1, GFP_KERNEL);
if (unlikely(!new->name)) {
kmem_cache_free(unionfs_filldir_cachep, new);
unlock_dir(lower_wh_dir_dentry);
if (err)
goto out;
- } else
+ } else {
dput(lower_wh_dentry);
+ }
dget(lower_old_dentry);
lower_old_dir_dentry = dget_parent(lower_old_dentry);
if (!IS_COPYUP_ERR(err))
goto out;
do_copyup = old_bstart - 1;
- } else
+ } else {
revert = 1;
+ }
/*
* Unlink all instances of destination that exist to the left of
local_err = vfs_create(lower_parent->d_inode, wh_old, S_IRUGO,
NULL);
unlock_dir(lower_parent);
- if (!local_err)
+ if (!local_err) {
set_dbopaque(old_dentry, bwh_old);
- else {
+ } else {
/*
* we can't fix anything now, so we cop-out and use
* -EIO.
if (err == -ENOTEMPTY) {
if (is_robranch(dentry))
return -EXDEV;
- } else if (err)
+ } else if (err) {
return err;
+ }
bstart = dbstart(dentry);
if (dbend(dentry) == bstart || dbopaque(dentry) == bstart)
* simply override it even if the whited-out dir is not empty.
*/
wh_dentry = lookup_whiteout(new_dentry);
- if (!IS_ERR(wh_dentry))
+ if (!IS_ERR(wh_dentry)) {
dput(wh_dentry);
- else if (new_dentry->d_inode) {
+ } else if (new_dentry->d_inode) {
if (S_ISDIR(old_dentry->d_inode->i_mode) !=
S_ISDIR(new_dentry->d_inode->i_mode)) {
err = S_ISDIR(old_dentry->d_inode->i_mode) ?
}
err = do_unionfs_rename(old_dir, old_dentry, new_dir, new_dentry);
out:
- if (err)
+ if (err) {
/* clear the new_dentry stuff created */
d_drop(new_dentry);
- else {
+ } else {
/*
* force re-lookup since the dir on ro branch is not renamed,
* and lower dentries still indicate the un-renamed ones.
if (dbstart(dentry) == 0)
goto out;
err = create_whiteout(dentry, dbstart(dentry) - 1);
- } else if (dbopaque(dentry) != -1)
+ } else if (dbopaque(dentry) != -1) {
/* There is a lower lower-priority file with the same name. */
err = create_whiteout(dentry, dbopaque(dentry));
- else
+ } else {
err = create_whiteout(dentry, dbstart(dentry));
+ }
out:
if (!err)
err = unionfs_rmdir_first(dir, dentry, namelist);
/* create whiteout */
- if (!err)
+ if (!err) {
err = create_whiteout(dentry, dbstart(dentry));
- else {
+ } else {
int new_err;
if (dbstart(dentry) == 0)