* [PATCH] better file error debugging
@ 2009-06-25 19:51 Dave Hansen
2009-06-27 10:33 ` Oren Laadan
0 siblings, 1 reply; 2+ messages in thread
From: Dave Hansen @ 2009-06-25 19:51 UTC (permalink / raw)
To: Oren Laadan; +Cc: containers
This should give a nice message with symbol names for when we have an
open file that doesn't have an f_op->checkpoint.
Something along the lines of:
[1133:c/r:checkpoint_file] file operations have no checkpoint handler:tty_open+0x0/0x24
diff --git a/checkpoint/files.c b/checkpoint/files.c
index 5be7d1b..566fc9a 100644
--- a/checkpoint/files.c
+++ b/checkpoint/files.c
@@ -193,8 +193,11 @@ int checkpoint_file(struct ckpt_ctx *ctx, void *ptr)
{
struct file *file = (struct file *) ptr;
- if (!file->f_op || !file->f_op->checkpoint)
+ if (!file->f_op || !file->f_op->checkpoint) {
+ ckpt_debug("file operations have no checkpoint handler: %pS\n",
+ file->f_op);
return -EBADF;
+ }
if (d_unhashed(file->f_dentry) && !IS_ROOT(file->f_dentry))
return -EBADF;
return file->f_op->checkpoint(ctx, file);
-- Dave
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] better file error debugging
2009-06-25 19:51 [PATCH] better file error debugging Dave Hansen
@ 2009-06-27 10:33 ` Oren Laadan
0 siblings, 0 replies; 2+ messages in thread
From: Oren Laadan @ 2009-06-27 10:33 UTC (permalink / raw)
To: Dave Hansen; +Cc: containers
Dave Hansen wrote:
> This should give a nice message with symbol names for when we have an
> open file that doesn't have an f_op->checkpoint.
>
> Something along the lines of:
>
> [1133:c/r:checkpoint_file] file operations have no checkpoint handler:tty_open+0x0/0x24
>
Nice, thanks.
Added with another ckpt_debug() for the unlinked file case.
Oren.
> diff --git a/checkpoint/files.c b/checkpoint/files.c
> index 5be7d1b..566fc9a 100644
> --- a/checkpoint/files.c
> +++ b/checkpoint/files.c
> @@ -193,8 +193,11 @@ int checkpoint_file(struct ckpt_ctx *ctx, void *ptr)
> {
> struct file *file = (struct file *) ptr;
>
> - if (!file->f_op || !file->f_op->checkpoint)
> + if (!file->f_op || !file->f_op->checkpoint) {
> + ckpt_debug("file operations have no checkpoint handler: %pS\n",
> + file->f_op);
> return -EBADF;
> + }
> if (d_unhashed(file->f_dentry) && !IS_ROOT(file->f_dentry))
> return -EBADF;
> return file->f_op->checkpoint(ctx, file);
>
>
>
> -- Dave
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-06-27 10:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-25 19:51 [PATCH] better file error debugging Dave Hansen
2009-06-27 10:33 ` Oren Laadan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox