mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Li Zhong <zhong@linux.vnet.ibm.com>
To: viro@ZenIV.linux.org.uk
Cc: linuxram@us.ibm.com, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, Li Zhong <zhong@linux.vnet.ibm.com>
Subject: [RFC PATCH 0/2] partial revoke implementation for procfs
Date: Thu, 11 Jul 2013 19:07:19 +0800	[thread overview]
Message-ID: <1373540841-30807-1-git-send-email-zhong@linux.vnet.ibm.com> (raw)

Hi Al Viro, 

I tried to implement what you proposed in:
https://lkml.org/lkml/2013/4/5/15

When you have time, would you please help to take a look at it, and give your 
comments? 
I sent the draft early, just want to make sure I didn't misunderstand anything
in your proposal, and what I did and next step plan are not heading the wrong
direction.

This is only an initial draft to do only what procfs is needed

1. didn't do anything about kick, mmap, fasync, ... and something you mentioned
in following mails

2. I only wrapped f_ops in vfs which are used by procfs ( but maybe I still
missed something). 

3. It seems all f_ops are const, so I couldn't easliy clear the pointer of
->owner, maybe that needs every calling site of proc_create(_data) to make sure
the proc_fops doesn't have ->owner set? 

Currently, I added an ugly check in __fput, so if if ->f_revoke is set in file,
we don't call fput_ops; and in proc_reg_open(), restore the old ->f_op if
make_revokable() fails.

patch 1: adding the implementation proposed in your mail
patch 2: convert procfs to use this implementation

If there aren't any big issues, I plan to look for another file system 
(with backing device) to try other things that's not implemented this time.

Thanks, Zhong

Li Zhong (2):
  vfs: partial revoke implementation suggested by Al Viro
  proc: covert procfs to use the general revoke implementation

 fs/Makefile            |    2 +-
 fs/compat_ioctl.c      |    8 +-
 fs/eventpoll.c         |   10 ++-
 fs/file_table.c        |   13 ++-
 fs/ioctl.c             |    7 +-
 fs/proc/generic.c      |   12 +--
 fs/proc/inode.c        |  229 ++++--------------------------------------------
 fs/proc/internal.h     |    9 +-
 fs/read_write.c        |   30 +++++--
 fs/revoke.c            |  133 ++++++++++++++++++++++++++++
 fs/select.c            |   11 ++-
 include/linux/fs.h     |    2 +
 include/linux/revoke.h |   50 +++++++++++
 mm/mmap.c              |    8 +-
 mm/nommu.c             |   16 +++-
 15 files changed, 297 insertions(+), 243 deletions(-)
 create mode 100644 fs/revoke.c
 create mode 100644 include/linux/revoke.h

-- 
1.7.9.5


             reply	other threads:[~2013-07-11 11:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-11 11:07 Li Zhong [this message]
2013-07-11 11:07 ` [PATCH 1/2] vfs: partial revoke implementation suggested by Al Viro Li Zhong
2013-07-11 11:07 ` [PATCH 2/2] proc: covert procfs to use the general revoke implementation Li Zhong

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=1373540841-30807-1-git-send-email-zhong@linux.vnet.ibm.com \
    --to=zhong@linux.vnet.ibm.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxram@us.ibm.com \
    --cc=viro@ZenIV.linux.org.uk \
    /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

all inboxes | Powered by JetHome®