linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Limin Gu <limin@dbear.engr.sgi.com>
To: kaigai@ak.jp.nec.com (Kaigai Kohei)
Cc: linux-kernel@vger.kernel.org,
	jengelh@linux01.gwdg.de (Jan Engelhardt),
	holt@sgi.com, jeffrey.hundstad@mnsu.edu, schwab@suse.de,
	rusty@rustcorp.com.au, chrisw@osdl.org, pagg@oss.sgi.com,
	limin@dbear.engr.sgi.com (Limin Gu)
Subject: Re: [RFC][PATCH] a revised job patch (with jobfs)
Date: Fri, 7 Jan 2005 10:05:27 -0800 (PST)	[thread overview]
Message-ID: <200501071805.j07I5R428218@dbear.engr.sgi.com> (raw)
In-Reply-To: <41DE7C69.3030008@ak.jp.nec.com> from "Kaigai Kohei" at Jan 07, 2005 09:11:21 PM

> 
> Hi, Limin Gu
> 
> This JOB-fs approach is so ambitious, I think.
> I tried to apply your JOB-fs patch toward 2.6.9,
> then I noticed some promlems as follows.

Hi KaiGai Kohei,

Thank you for your interest in job. I am planning to post a slightly modified
version of job patch against 2.6.10 pretty soon, and also the pointer to the 
job userland library and commands.

> 
> (1) The JOB-fs patch needs include/linux/jobctl.h and include/linux/job_acct.h.
>   But these are contained in linux-2.6.9-job.patch, not JOB-fs patch.
>   Since those patches conflict, we need to extract the jobctl.h and job_acct.h
>   from linux-2.6.9-job.patch.

The jobfs patch I posted last time should not need include/linux/jobctl.h and 
include/linux/job_acct.h, it only needed include/linux/job.h. I don't know 
why you had that problem.  

Your questions below 2-4 are all related to how to use job in the userland.
We provide an extensive job library (libjob.so) for C codes, and serveral
job commands for shell enviroment. User should use the library and commands
instead of directly use /bin/mkdir and echo, the reason is that we want to
maintain the job library and command the same as before and we want jobfs
as simple as possible.  

> 
> (2) The return value of mkdir() under the /jids is strange.

Yes, the return value is hacked to return the newly created jid. 

>   The directory of 'jids' has a mkdir() method implemented by jobfs_mkdir().
>   Since jobfs_mkdir() returns the result of job_create() transparently,
>   my mkdir operations alwaly failed.
>   ----------------
>   /*
>    * job_create - create a new job and attache the calling process to it.
>    * @jid: new job id
>    * @user: job owner
>    * @options: not used
>    *
>    * return 0 on job is DISABLE, -errno on failure, 1 on success
>    */
>   ----------------
>   This is the description of job_create(). This returns 1 on success,
>   but VFS layer recognize it as a failure.
> 
>   I modified this as follows:
> --- job.c   2005-01-06 20:03:47.000000000 +0900
> +++ kaigai_job.c       2005-01-07 20:16:55.518703400 +0900
> @@ -1505,5 +1505,5 @@
>                  return -EINVAL;
>          ret = job_create(jid, current->uid, 0);
> -       return ret;
> +       return (ret==1) ? 0 : ((ret==0) ? -EINVAL : ret); // Dirty?
>   }
> 
> (3) We can not make a JOB by using a /bin/mkdir command.

We provide job_create() library call for job creation.

We also provide a library pam_job.so that allows job creation through 
PAM modules. For example, if add "account optional /lib/security/pam_job.so" 
line to /etc/pam.d/rlogin file, every rlogin will create a new job, and
all the processes from that login are contained in the same job, unless
somebody with proper permission decide to detach (processes or the job). 


>   When I execute '/bin/mkdir' on shell program, new process was fork()'ed and execve()'ed.
>   This process calls mkdir() system-call and it create a JOB which contains only
>   the self process.
>   Then '/bin/mkdir' exits process, and the JOB created by '/bin/mkdir' contains no process.
>   So, the JOB was destroied soon.
>   For avoidance the problem, we need to 'create_job' command which calls mkdir() and
>   execve('/bin/bash') in the one process.
>   Or pagg+job framework need to allow the existance of the empty JOB.
> 
> (4) "echo '123' > hid" fails by -EPERM.

We have job_sethid() library call, and jsethid command avaible.


>   When we open the 'hid' with O_TRUNC flag, operation returns -EPERM.
>   setattr() method of 'hid' was called on extention of sys_open().
>   * sys_open() -> filp_open() -> open_namei() -> may_open()
>     -> do_truncate() (When O_TRUNC was appended)
>       -> notify_change()
>         -> inode's setattr() (It always returns -EPERM.)
>   If we can't use 'echo', it's pretty inexpediency.
> 
> And, would you have this discussion on PAGG-ML also ?
> Because LKML has huge traffic, I have not noticed job-fs for two weeks. orz
> Thanks.

Good idea. Thanks!

I am planning to post the new job patch(with jobfs implementation) and a new
job userland rpm, i.e. the job library and commands that work with jobfs 
instead of the current ioctl calls, today on oss.sgi.com/projects/pagg.
Let me know any problems. I appreciate your time.

--Limin


> -- 
> Linux Promotion Center, NEC
> KaiGai Kohei <kaigai@ak.jp.nec.com>
> 


      reply	other threads:[~2005-01-07 18:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-16  0:06 [RFC][PATCH] a revised job patch (with jobfs) Limin Gu
2005-01-07 12:11 ` Kaigai Kohei
2005-01-07 18:05   ` Limin Gu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200501071805.j07I5R428218@dbear.engr.sgi.com \
    --to=limin@dbear.engr.sgi.com \
    --cc=chrisw@osdl.org \
    --cc=holt@sgi.com \
    --cc=jeffrey.hundstad@mnsu.edu \
    --cc=jengelh@linux01.gwdg.de \
    --cc=kaigai@ak.jp.nec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pagg@oss.sgi.com \
    --cc=rusty@rustcorp.com.au \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).