mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: viro@ftp.linux.org.uk
Cc: kwc@citi.umich.edu, Trond.Myklebust@netapp.com,
	linux-kernel@vger.kernel.org, dhowells@redhat.com
Subject: [PATCH 43/52] CRED: Pass credentials through the statfs() superblock op
Date: Fri, 12 Oct 2007 17:08:59 +0100	[thread overview]
Message-ID: <20071012160859.15119.52857.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20071012160519.15119.69608.stgit@warthog.procyon.org.uk>

Pass credentials through the statfs() superblock operation.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 fs/afs/super.c     |    6 ++++--
 fs/ext3/super.c    |    6 ++++--
 fs/fat/inode.c     |    3 ++-
 fs/libfs.c         |    2 +-
 fs/nfs/super.c     |    6 +++---
 fs/open.c          |    3 ++-
 include/linux/fs.h |    4 ++--
 mm/shmem.c         |    3 ++-
 8 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/fs/afs/super.c b/fs/afs/super.c
index 82ccd94..c7d7c1c 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -35,7 +35,8 @@ static int afs_get_sb(struct file_system_type *fs_type,
 static struct inode *afs_alloc_inode(struct super_block *sb);
 static void afs_put_super(struct super_block *sb);
 static void afs_destroy_inode(struct inode *inode);
-static int afs_statfs(struct dentry *dentry, struct kstatfs *buf);
+static int afs_statfs(struct dentry *dentry, struct kstatfs *buf,
+		      struct cred *cred);
 
 struct file_system_type afs_fs_type = {
 	.owner		= THIS_MODULE,
@@ -511,7 +512,8 @@ static void afs_destroy_inode(struct inode *inode)
 /*
  * return information about an AFS volume
  */
-static int afs_statfs(struct dentry *dentry, struct kstatfs *buf)
+static int afs_statfs(struct dentry *dentry, struct kstatfs *buf,
+		      struct cred *cred)
 {
 	struct afs_volume_status vs;
 	struct afs_vnode *vnode = AFS_FS_I(dentry->d_inode);
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 348bb6b..29a41cc 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -59,7 +59,8 @@ static int ext3_sync_fs(struct super_block *sb, int wait);
 static const char *ext3_decode_error(struct super_block * sb, int errno,
 				     char nbuf[16]);
 static int ext3_remount (struct super_block * sb, int * flags, char * data);
-static int ext3_statfs (struct dentry * dentry, struct kstatfs * buf);
+static int ext3_statfs (struct dentry * dentry, struct kstatfs * buf,
+			struct cred *cred);
 static void ext3_unlockfs(struct super_block *sb);
 static void ext3_write_super (struct super_block * sb);
 static void ext3_write_super_lockfs(struct super_block *sb);
@@ -2429,7 +2430,8 @@ restore_opts:
 	return err;
 }
 
-static int ext3_statfs (struct dentry * dentry, struct kstatfs * buf)
+static int ext3_statfs (struct dentry * dentry, struct kstatfs * buf,
+			struct cred *cred)
 {
 	struct super_block *sb = dentry->d_sb;
 	struct ext3_sb_info *sbi = EXT3_SB(sb);
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 519e1b4..a224325 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -537,7 +537,8 @@ static int fat_remount(struct super_block *sb, int *flags, char *data)
 	return 0;
 }
 
-static int fat_statfs(struct dentry *dentry, struct kstatfs *buf)
+static int fat_statfs(struct dentry *dentry, struct kstatfs *buf,
+		      struct cred *cred)
 {
 	struct msdos_sb_info *sbi = MSDOS_SB(dentry->d_sb);
 
diff --git a/fs/libfs.c b/fs/libfs.c
index 107412e..e214329 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -20,7 +20,7 @@ int simple_getattr(struct vfsmount *mnt, struct dentry *dentry,
 	return 0;
 }
 
-int simple_statfs(struct dentry *dentry, struct kstatfs *buf)
+int simple_statfs(struct dentry *dentry, struct kstatfs *buf, struct cred *cred)
 {
 	buf->f_type = dentry->d_sb->s_magic;
 	buf->f_bsize = PAGE_CACHE_SIZE;
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 44e2583..524e8a1 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -220,7 +220,7 @@ static match_table_t nfs_secflavor_tokens = {
 
 
 static void nfs_umount_begin(struct vfsmount *, int);
-static int  nfs_statfs(struct dentry *, struct kstatfs *);
+static int  nfs_statfs(struct dentry *, struct kstatfs *, struct cred *);
 static int  nfs_show_options(struct seq_file *, struct vfsmount *);
 static int  nfs_show_stats(struct seq_file *, struct vfsmount *);
 static int nfs_get_sb(struct file_system_type *, int, const char *, void *,
@@ -358,9 +358,9 @@ void __exit unregister_nfs_fs(void)
 /*
  * Deliver file system statistics to userspace
  */
-static int nfs_statfs(struct dentry *dentry, struct kstatfs *buf)
+static int nfs_statfs(struct dentry *dentry, struct kstatfs *buf,
+		      struct cred *acred)
 {
-	struct cred *acred = current->cred;
 	struct nfs_server *server = NFS_SB(dentry->d_sb);
 	unsigned char blockbits;
 	unsigned long blockres;
diff --git a/fs/open.c b/fs/open.c
index c383efe..291f875 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -30,6 +30,7 @@
 
 int vfs_statfs(struct dentry *dentry, struct kstatfs *buf)
 {
+	struct cred *cred = current->cred;
 	int retval = -ENODEV;
 
 	if (dentry) {
@@ -39,7 +40,7 @@ int vfs_statfs(struct dentry *dentry, struct kstatfs *buf)
 			retval = security_sb_statfs(dentry);
 			if (retval)
 				return retval;
-			retval = dentry->d_sb->s_op->statfs(dentry, buf);
+			retval = dentry->d_sb->s_op->statfs(dentry, buf, cred);
 			if (retval == 0 && buf->f_frsize == 0)
 				buf->f_frsize = buf->f_bsize;
 		}
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 658bdc8..2fec09a 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1199,7 +1199,7 @@ struct super_operations {
 	int (*sync_fs)(struct super_block *sb, int wait);
 	void (*write_super_lockfs) (struct super_block *);
 	void (*unlockfs) (struct super_block *);
-	int (*statfs) (struct dentry *, struct kstatfs *);
+	int (*statfs) (struct dentry *, struct kstatfs *, struct cred *);
 	int (*remount_fs) (struct super_block *, int *, char *);
 	void (*clear_inode) (struct inode *);
 	void (*umount_begin) (struct vfsmount *, int);
@@ -1801,7 +1801,7 @@ extern int dcache_dir_close(struct inode *, struct file *);
 extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
 extern int dcache_readdir(struct file *, void *, filldir_t);
 extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *);
-extern int simple_statfs(struct dentry *, struct kstatfs *);
+extern int simple_statfs(struct dentry *, struct kstatfs *, struct cred *);
 extern int simple_link(struct dentry *, struct inode *, struct dentry *,
 		       struct cred *);
 extern int simple_unlink(struct inode *, struct dentry *, struct cred *);
diff --git a/mm/shmem.c b/mm/shmem.c
index 4bcfdb8..432f023 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1682,7 +1682,8 @@ static ssize_t shmem_file_read(struct file *filp, char __user *buf, size_t count
 	return desc.error;
 }
 
-static int shmem_statfs(struct dentry *dentry, struct kstatfs *buf)
+static int shmem_statfs(struct dentry *dentry, struct kstatfs *buf,
+			struct cred *cred)
 {
 	struct shmem_sb_info *sbinfo = SHMEM_SB(dentry->d_sb);
 


  parent reply	other threads:[~2007-10-12 16:28 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-12 16:05 [PATCH 00/52] Introduce credential record David Howells
2007-10-12 16:05 ` [PATCH 01/52] CRED: Introduce a COW credentials record David Howells
2007-10-15  1:53   ` David Chinner
2007-10-12 16:05 ` [PATCH 02/52] CRED: Give in_group_p() a cred pointer David Howells
2007-10-12 16:05 ` [PATCH 03/52] CRED: Pass credentials down to ext3 block allocator David Howells
2007-10-12 16:05 ` [PATCH 04/52] CRED: Pass credentials down to ext3 inode allocator David Howells
2007-10-12 16:05 ` [PATCH 05/52] CRED: Prepare TMPFS for cred passing David Howells
2007-10-12 16:05 ` [PATCH 06/52] CRED: Prepare RAMFS " David Howells
2007-10-12 16:05 ` [PATCH 07/52] CRED: Pass credentials down to ext2 block allocator David Howells
2007-10-12 16:06 ` [PATCH 08/52] CRED: Pass credentials down to ext2 inode allocator David Howells
2007-10-12 16:06 ` [PATCH 09/52] CRED: Pass credentials down to ext4 block allocator David Howells
2007-10-12 16:06 ` [PATCH 10/52] CRED: Pass credentials down to ext4 inode allocator David Howells
2007-10-12 16:06 ` [PATCH 11/52] CRED: Give the get_block() callback a credentials pointer David Howells
2007-10-12 16:06 ` [PATCH 12/52] CRED: Make mpage read functions take " David Howells
2007-10-12 16:06 ` [PATCH 13/52] CRED: Make block_prepare_write() and co " David Howells
2007-10-12 16:06 ` [PATCH 14/52] CRED: Provide a writeback credentials record David Howells
2007-10-12 16:06 ` [PATCH 15/52] CRED: Make Ext3 use the writeback credentials David Howells
2007-10-12 16:06 ` [PATCH 16/52] CRED: Pass credentials through the internals of ext3 truncation David Howells
2007-10-12 16:06 ` [PATCH 17/52] CRED: Make rpcauth_lookupcred() take a credentials pointer David Howells
2007-10-12 16:06 ` [PATCH 18/52] CRED: Make rpcauth_bindcred() " David Howells
2007-10-12 16:06 ` [PATCH 19/52] CRED: Add a credentials pointer to struct rpc_task David Howells
2007-10-12 16:07 ` [PATCH 20/52] CRED: Pass credentials into rpc_init_task() David Howells
2007-10-12 16:07 ` [PATCH 21/52] CRED: Pass credentials through the truncate() inode operation David Howells
2007-10-12 16:07 ` [PATCH 22/52] CRED: Pass credentials to nfs_setattr_update_inode() David Howells
2007-10-12 16:07 ` [PATCH 23/52] CRED: Pass credentials to the setattr() inode operation David Howells
2007-10-12 16:07 ` [PATCH 24/52] CRED: Pass credentials through inode_setattr() David Howells
2007-10-12 16:07 ` [PATCH 25/52] CRED: Give the mknod() inode op a credentials pointer David Howells
2007-10-12 16:07 ` [PATCH 26/52] CRED: Give the mkdir() " David Howells
2007-10-12 16:07 ` [PATCH 27/52] CRED: Give the create() " David Howells
2007-10-12 16:07 ` [PATCH 28/52] CRED: Give the link() " David Howells
2007-10-12 16:07 ` [PATCH 29/52] CRED: Give the unlink() " David Howells
2007-10-12 16:07 ` [PATCH 30/52] CRED: Give the rmdir() " David Howells
2007-10-12 16:07 ` [PATCH 31/52] CRED: Give the rename() " David Howells
2007-10-12 16:08 ` [PATCH 32/52] CRED: Give the symlink() " David Howells
2007-10-12 16:08 ` [PATCH 33/52] CRED: Make the get_parent() export op take a credential pointer David Howells
2007-10-12 16:08 ` [PATCH 34/52] CRED: Make Ext3 ACL set handlers pass credentials down David Howells
2007-10-12 16:08 ` [PATCH 35/52] CRED: Make the ACL set() handler take a credentials pointer David Howells
2007-10-12 16:08 ` [PATCH 36/52] CRED: Make ext3_fill_super() pass credentials down David Howells
2007-10-12 16:08 ` [PATCH 37/52] CRED: Pass credentials to the get_sb() op and various fill_super() ops David Howells
2007-10-12 16:08 ` [PATCH 38/52] CRED: Pass credentials through the quota_read() op David Howells
2007-10-12 16:08 ` [PATCH 39/52] CRED: Pass credentials through the quota_write() op David Howells
2007-10-12 16:08 ` [PATCH 40/52] CRED: Give the lookup() inode op a credentials pointer David Howells
2007-10-12 16:08 ` [PATCH 41/52] CRED: Pass credentials through d_revalidate() David Howells
2007-10-12 16:08 ` [PATCH 42/52] CRED: Pass credentials through the permission() inode op David Howells
2007-10-12 16:08 ` David Howells [this message]
2007-10-12 16:09 ` [PATCH 44/52] CRED: Pass credentials through the follow_link() " David Howells
2007-10-12 16:09 ` [PATCH 45/52] CRED: Pass credentials through the getattr() " David Howells
2007-10-12 16:09 ` [PATCH 46/52] CRED: Pass credentials through the setxattr() " David Howells
2007-10-12 16:09 ` [PATCH 47/52] CRED: Pass credentials through the xattr get() handler David Howells
2007-10-12 16:09 ` [PATCH 48/52] CRED: Pass credentials through the getxattr() inode op David Howells
2007-10-12 16:09 ` [PATCH 49/52] CRED: Pass credentials through the xattr list() handler David Howells
2007-10-12 16:09 ` [PATCH 50/52] CRED: Pass credentials through the listxattr() inode op David Howells
2007-10-12 16:09 ` [PATCH 51/52] CRED: Pass credentials through the removexattr() " David Howells
2007-10-12 16:09 ` [PATCH 52/52] CRED: Pass credentials through vfs_mkdir() David Howells
2007-10-13 18:11 ` [PATCH 00/52] Introduce credential record Theodore Tso
2007-10-13 18:19   ` Al Viro
2007-10-13 21:46 ` David Howells

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=20071012160859.15119.52857.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=kwc@citi.umich.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ftp.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®