switch (cmd) {
case UNIONFS_IOCTL_INCGEN:
/* Increment the superblock generation count */
- printk("unionfs: incgen ioctl deprecated; "
- "use \"-o remount,incgen\"\n");
+ pr_info("unionfs: incgen ioctl deprecated; "
+ "use \"-o remount,incgen\"\n");
err = -ENOSYS;
break;
err = args.err;
release_lower_nd(&nd, err);
} else {
- printk(KERN_ERR "unionfs: unknown inode type %d\n",
+ printk(KERN_CRIT "unionfs: unknown inode type %d\n",
old_mode);
BUG();
}
*/
if (unlikely(timespec_compare(&inode->i_mtime,
&lower_inode->i_mtime) < 0)) {
- printk("unionfs: new lower inode mtime "
- "(bindex=%d, name=%s)\n", bindex,
- dentry->d_name.name);
+ pr_info("unionfs: new lower inode mtime "
+ "(bindex=%d, name=%s)\n", bindex,
+ dentry->d_name.name);
show_dinode_times(dentry);
return true; /* mtime changed! */
}
if (unlikely(timespec_compare(&inode->i_ctime,
&lower_inode->i_ctime) < 0)) {
- printk("unionfs: new lower inode ctime "
- "(bindex=%d, name=%s)\n", bindex,
- dentry->d_name.name);
+ pr_info("unionfs: new lower inode ctime "
+ "(bindex=%d, name=%s)\n", bindex,
+ dentry->d_name.name);
show_dinode_times(dentry);
return true; /* ctime changed! */
}
*/
chain = kzalloc(chain_len * sizeof(struct dentry *), GFP_KERNEL);
if (unlikely(!chain)) {
- printk("unionfs: no more memory in %s\n", __FUNCTION__);
+ printk(KERN_CRIT "unionfs: no more memory in %s\n", __FUNCTION__);
goto out;
}
unionfs_check_dentry(dentry);
/* this could be a negative dentry, so check first */
if (unlikely(!UNIONFS_D(dentry))) {
- printk(KERN_DEBUG "unionfs: dentry without private data: %.*s\n",
+ printk(KERN_ERR "unionfs: dentry without private data: %.*s\n",
dentry->d_name.len, dentry->d_name.name);
goto out;
} else if (dbstart(dentry) < 0) {
/* this is due to a failed lookup */
- printk(KERN_DEBUG "unionfs: dentry without lower "
+ printk(KERN_ERR "unionfs: dentry without lower "
"dentries: %.*s\n",
dentry->d_name.len, dentry->d_name.name);
goto out_free;
lower_file = unionfs_lower_file(file);
if (willwrite && !lower_file->f_mapping->a_ops->writepage) {
err = -EINVAL;
- printk("unionfs: branch %d file system does not support "
- "writeable mmap\n", fbstart(file));
+ printk(KERN_ERR "unionfs: branch %d file system does not "
+ "support writeable mmap\n", fbstart(file));
} else {
err = generic_file_mmap(file, vma);
if (err)
- printk("unionfs: generic_file_mmap failed %d\n", err);
+ printk(KERN_ERR
+ "unionfs: generic_file_mmap failed %d\n", err);
}
out:
unlock_dir(lower_dir_dentry);
if (err) {
- printk("unionfs: create: could not unlink "
- "whiteout, err = %d\n", err);
+ printk(KERN_ERR "unionfs: create: could not "
+ "unlink whiteout, err = %d\n", err);
goto out;
}
}
if (IS_ERR(lower_dentry))
err = PTR_ERR(lower_dentry);
- printk(KERN_DEBUG "unionfs: lower dentry "
+ printk(KERN_ERR "unionfs: lower dentry "
"NULL (or error) for bindex = %d\n",
bindex);
continue;
dentry->d_name.name,
bindex);
if (!lower_dentry || IS_ERR(lower_dentry)) {
- printk(KERN_DEBUG "unionfs: lower dentry "
+ printk(KERN_ERR "unionfs: lower dentry "
" NULL for bindex = %d\n", bindex);
continue;
}
dentry->d_name.name,
bindex);
if (IS_ERR(lower_dentry)) {
- printk(KERN_DEBUG "unionfs: failed to create "
+ printk(KERN_ERR "unionfs: failed to create "
"parents on %d, err = %ld\n",
bindex, PTR_ERR(lower_dentry));
continue;
unionfs_lock_dentry(dentry);
if (unlikely(!__unionfs_d_revalidate_chain(dentry, nd, false)))
- printk("unionfs: put_link failed to revalidate dentry\n");
+ printk(KERN_ERR
+ "unionfs: put_link failed to revalidate dentry\n");
unionfs_unlock_dentry(dentry);
unionfs_check_dentry(dentry);
if (ia->ia_size != i_size_read(inode)) {
err = vmtruncate(inode, ia->ia_size);
if (err)
- printk("unionfs: setattr: vmtruncate failed\n");
+ printk(KERN_ERR
+ "unionfs: setattr: vmtruncate failed\n");
}
}
break;
}
err = -EIO;
- printk(KERN_NOTICE "unionfs: EIO: invalid whiteout "
+ printk(KERN_ERR "unionfs: EIO: invalid whiteout "
"entry type %d.\n",
wh_lower_dentry->d_inode->i_mode);
dput(wh_lower_dentry);
/* Do nothing. */
break;
default:
- printk(KERN_ERR "unionfs: invalid interpose flag passed!\n");
+ printk(KERN_CRIT "unionfs: invalid interpose flag passed!\n");
BUG();
}
goto out;
struct dentry *dent2;
if (options[0] == '\0') {
- printk(KERN_WARNING "unionfs: no branches specified\n");
+ printk(KERN_ERR "unionfs: no branches specified\n");
err = -EINVAL;
goto out;
}
err = path_lookup(name, LOOKUP_FOLLOW, &nd);
if (err) {
- printk(KERN_WARNING "unionfs: error accessing "
+ printk(KERN_ERR "unionfs: error accessing "
"lower directory '%s' (error %d)\n",
name, err);
goto out;
}
if ((err = check_branch(&nd))) {
- printk(KERN_WARNING "unionfs: lower directory "
+ printk(KERN_ERR "unionfs: lower directory "
"'%s' is not a valid branch\n", name);
path_release(&nd);
goto out;
}
if (branches == 0) {
- printk(KERN_WARNING "unionfs: no branches specified\n");
+ printk(KERN_ERR "unionfs: no branches specified\n");
err = -EINVAL;
goto out;
}
for (j = i + 1; j < branches; j++) {
dent2 = lower_root_info->lower_paths[j].dentry;
if (is_branch_overlap(dent1, dent2)) {
- printk(KERN_WARNING "unionfs: branches %d and "
+ printk(KERN_ERR "unionfs: branches %d and "
"%d overlap\n", i, j);
err = -EINVAL;
goto out;
* don't, above this check.
*/
if (!optarg) {
- printk("unionfs: %s requires an argument.\n", optname);
+ printk(KERN_ERR "unionfs: %s requires an argument.\n",
+ optname);
err = -EINVAL;
goto out_error;
}
if (!strcmp("dirs", optname)) {
if (++dirsfound > 1) {
- printk(KERN_WARNING
+ printk(KERN_ERR
"unionfs: multiple dirs specified\n");
err = -EINVAL;
goto out_error;
/* All of these options require an integer argument. */
intval = simple_strtoul(optarg, &endptr, 0);
if (*endptr) {
- printk(KERN_WARNING
+ printk(KERN_ERR
"unionfs: invalid %s option '%s'\n",
optname, optarg);
err = -EINVAL;
}
err = -EINVAL;
- printk(KERN_WARNING
+ printk(KERN_ERR
"unionfs: unrecognized option '%s'\n", optname);
goto out_error;
}
if (dirsfound != 1) {
- printk(KERN_WARNING "unionfs: dirs option required\n");
+ printk(KERN_ERR "unionfs: dirs option required\n");
err = -EINVAL;
goto out_error;
}
int bindex, bstart, bend;
if (!raw_data) {
- printk(KERN_WARNING
+ printk(KERN_ERR
"unionfs: read_super: missing data argument\n");
err = -EINVAL;
goto out;
/* Allocate superblock private data */
sb->s_fs_info = kzalloc(sizeof(struct unionfs_sb_info), GFP_KERNEL);
if (unlikely(!UNIONFS_SB(sb))) {
- printk(KERN_WARNING "unionfs: read_super: out of memory\n");
+ printk(KERN_CRIT "unionfs: read_super: out of memory\n");
err = -ENOMEM;
goto out;
}
lower_root_info = unionfs_parse_options(sb, raw_data);
if (IS_ERR(lower_root_info)) {
- printk(KERN_WARNING
+ printk(KERN_ERR
"unionfs: read_super: error while parsing options "
"(err = %ld)\n", PTR_ERR(lower_root_info));
err = PTR_ERR(lower_root_info);
{
int err;
- printk("Registering unionfs " UNIONFS_VERSION "\n");
+ pr_info("Registering unionfs " UNIONFS_VERSION "\n");
if (unlikely((err = unionfs_init_filldir_cache())))
goto out;
unionfs_destroy_inode_cache();
unionfs_destroy_dentry_cache();
unregister_filesystem(&unionfs_fs_type);
- printk("Completed unionfs module unload.\n");
+ pr_info("Completed unionfs module unload\n");
}
MODULE_AUTHOR("Erez Zadok, Filesystems and Storage Lab, Stony Brook University"
*/
lower_page = find_lock_page(lower_inode->i_mapping, page->index);
if (!lower_page) {
- printk(KERN_DEBUG "unionfs: find_lock_page failed\n");
+ printk(KERN_ERR "unionfs: find_lock_page failed\n");
goto out;
}
* system is corrupted.
*/
if (unlikely(cursor->bindex == rdstate->bindex)) {
- printk(KERN_DEBUG "unionfs: filldir: possible "
+ printk(KERN_ERR "unionfs: filldir: possible "
"I/O error: a file is duplicated "
"in the same branch %d: %s\n",
rdstate->bindex, cursor->name);
new_dentry, new_dentry->d_name.name,
bindex);
if (IS_ERR(lower_new_dentry)) {
- printk(KERN_DEBUG "unionfs: error creating directory "
+ printk(KERN_ERR "unionfs: error creating directory "
"tree for rename, bindex = %d, err = %ld\n",
bindex, PTR_ERR(lower_new_dentry));
err = PTR_ERR(lower_new_dentry);
if (lower_wh_dentry->d_inode) {
/* get rid of the whiteout that is existing */
if (lower_new_dentry->d_inode) {
- printk(KERN_WARNING "unionfs: both a whiteout and a "
+ printk(KERN_ERR "unionfs: both a whiteout and a "
"dentry exist when doing a rename!\n");
err = -EIO;
/* Do revert here. */
local_err = unionfs_refresh_lower_dentry(new_dentry, old_bstart);
if (local_err) {
- printk(KERN_WARNING "unionfs: revert failed in rename: "
+ printk(KERN_ERR "unionfs: revert failed in rename: "
"the new refresh failed.\n");
eio = -EIO;
}
local_err = unionfs_refresh_lower_dentry(old_dentry, old_bstart);
if (local_err) {
- printk(KERN_WARNING "unionfs: revert failed in rename: "
+ printk(KERN_ERR "unionfs: revert failed in rename: "
"the old refresh failed.\n");
eio = -EIO;
goto revert_out;
if (!unionfs_lower_dentry_idx(new_dentry, bindex) ||
!unionfs_lower_dentry_idx(new_dentry, bindex)->d_inode) {
- printk(KERN_WARNING "unionfs: revert failed in rename: "
+ printk(KERN_ERR "unionfs: revert failed in rename: "
"the object disappeared from under us!\n");
eio = -EIO;
goto revert_out;
if (unionfs_lower_dentry_idx(old_dentry, bindex) &&
unionfs_lower_dentry_idx(old_dentry, bindex)->d_inode) {
- printk(KERN_WARNING "unionfs: revert failed in rename: "
+ printk(KERN_ERR "unionfs: revert failed in rename: "
"the object was created underneath us!\n");
eio = -EIO;
goto revert_out;
/* If we can't fix it, then we cop-out with -EIO. */
if (local_err) {
- printk(KERN_WARNING "unionfs: revert failed in rename!\n");
+ printk(KERN_ERR "unionfs: revert failed in rename!\n");
eio = -EIO;
}
dentry->d_name.name,
bindex);
if (!lower_dentry || IS_ERR(lower_dentry)) {
- printk(KERN_DEBUG "unionfs: create_parents "
+ printk(KERN_ERR "unionfs: create_parents "
"failed for bindex = %d\n", bindex);
continue;
}
size = sbmax(inode->i_sb) * sizeof(struct inode *);
info->lower_inodes = kzalloc(size, GFP_KERNEL);
if (unlikely(!info->lower_inodes)) {
- printk(KERN_ERR "unionfs: no kernel memory when allocating "
+ printk(KERN_CRIT "unionfs: no kernel memory when allocating "
"lower-pointer array!\n");
BUG();
}
/* Make sure we have no leaks of branchget/branchput. */
for (bindex = bstart; bindex <= bend; bindex++)
if (unlikely(branch_count(sb, bindex) != 0)) {
- printk("unionfs: branch %d has %d references left!\n",
+ printk(KERN_CRIT
+ "unionfs: branch %d has %d references left!\n",
bindex, branch_count(sb, bindex));
leaks = 1;
}
/* by now, optarg contains the branch name */
if (!*optarg) {
- printk("unionfs: no branch specified for mode change.\n");
+ printk(KERN_ERR
+ "unionfs: no branch specified for mode change.\n");
goto out;
}
if (!modename) {
- printk("unionfs: branch \"%s\" requires a mode.\n", optarg);
+ printk(KERN_ERR "unionfs: branch \"%s\" requires a mode.\n",
+ optarg);
goto out;
}
*modename++ = '\0';
perms = __parse_branch_mode(modename);
if (perms == 0) {
- printk("unionfs: invalid mode \"%s\" for \"%s\".\n",
+ printk(KERN_ERR "unionfs: invalid mode \"%s\" for \"%s\".\n",
modename, optarg);
goto out;
}
*/
err = path_lookup(optarg, LOOKUP_FOLLOW, &nd);
if (err) {
- printk(KERN_WARNING "unionfs: error accessing "
+ printk(KERN_ERR "unionfs: error accessing "
"lower directory \"%s\" (error %d)\n",
optarg, err);
goto out;
path_release(&nd); /* no longer needed */
if (idx == cur_branches) {
err = -ENOENT; /* err may have been reset above */
- printk(KERN_WARNING "unionfs: branch \"%s\" "
+ printk(KERN_ERR "unionfs: branch \"%s\" "
"not found\n", optarg);
goto out;
}
*/
err = path_lookup(optarg, LOOKUP_FOLLOW, &nd);
if (err) {
- printk(KERN_WARNING "unionfs: error accessing "
+ printk(KERN_ERR "unionfs: error accessing "
"lower directory \"%s\" (error %d)\n",
optarg, err);
goto out;
break;
path_release(&nd); /* no longer needed */
if (idx == cur_branches) {
- printk(KERN_WARNING "unionfs: branch \"%s\" "
+ printk(KERN_ERR "unionfs: branch \"%s\" "
"not found\n", optarg);
err = -ENOENT;
goto out;
*/
err = path_lookup(optarg, LOOKUP_FOLLOW, &nd);
if (err) {
- printk(KERN_WARNING "unionfs: error accessing "
+ printk(KERN_ERR "unionfs: error accessing "
"lower directory \"%s\" (error %d)\n",
optarg, err);
goto out;
break;
path_release(&nd); /* no longer needed */
if (idx == cur_branches) {
- printk(KERN_WARNING "unionfs: branch \"%s\" "
+ printk(KERN_ERR "unionfs: branch \"%s\" "
"not found\n", optarg);
err = -ENOENT;
goto out;
perms = parse_branch_mode(modename);
if (!new_branch || !*new_branch) {
- printk(KERN_WARNING "unionfs: null new branch\n");
+ printk(KERN_ERR "unionfs: null new branch\n");
err = -EINVAL;
goto out;
}
err = path_lookup(new_branch, LOOKUP_FOLLOW, &nd);
if (err) {
- printk(KERN_WARNING "unionfs: error accessing "
+ printk(KERN_ERR "unionfs: error accessing "
"lower directory \"%s\" (error %d)\n",
new_branch, err);
goto out;
* code base supports that correctly.
*/
if ((err = check_branch(&nd))) {
- printk(KERN_WARNING "unionfs: lower directory "
+ printk(KERN_ERR "unionfs: lower directory "
"\"%s\" is not a valid branch\n", optarg);
path_release(&nd);
goto out;
* allowed/supported as of now).
*/
if ((*flags & ~(MS_RDONLY | MS_SILENT)) != 0) {
- printk(KERN_WARNING
+ printk(KERN_ERR
"unionfs: remount flags 0x%x unsupported\n", *flags);
err = -EINVAL;
goto out_error;
kfree(tmp_to_free);
/* after all changes, will we have at least one branch left? */
if ((new_branches + add_branches - del_branches) < 1) {
- printk(KERN_WARNING
+ printk(KERN_ERR
"unionfs: no branches left after remount\n");
err = -EINVAL;
goto out_free;
* contains the CMD part and optarg contains the ARG part.
*/
if (!optarg || !*optarg) {
- printk("unionfs: all remount options require "
+ printk(KERN_ERR "unionfs: all remount options require "
"an argument (%s).\n", optname);
err = -EINVAL;
goto out_release;
goto out_release;
new_branches++;
if (new_branches > UNIONFS_MAX_BRANCHES) {
- printk("unionfs: command exceeds "
+ printk(KERN_ERR "unionfs: command exceeds "
"%d branches\n", UNIONFS_MAX_BRANCHES);
err = -E2BIG;
goto out_release;
}
err = -EINVAL;
- printk(KERN_WARNING
+ printk(KERN_ERR
"unionfs: unrecognized option \"%s\"\n", optname);
goto out_release;
}
*******************************************************************/
if (!(tmp_data[0].branchperms & MAY_WRITE)) {
- printk("unionfs: leftmost branch cannot be read-only "
+ printk(KERN_ERR "unionfs: leftmost branch cannot be read-only "
"(use \"remount,ro\" to create a read-only union)\n");
err = -EINVAL;
goto out_release;
atomic_set(&UNIONFS_D(sb->s_root)->generation, i);
atomic_set(&UNIONFS_I(sb->s_root->d_inode)->generation, i);
if (!(*flags & MS_SILENT))
- printk("unionfs: new generation number %d\n", i);
+ pr_info("unionfs: new generation number %d\n", i);
/* finally, update the root dentry's times */
unionfs_copy_attr_times(sb->s_root->d_inode);
err = 0; /* reset to success */