* [patch 1/9] unprivileged mounts: fix subtype handling
2007-08-09 9:20 [patch 0/9] assorted fixes and cleanups miklos
@ 2007-08-09 9:20 ` miklos
2007-08-09 9:20 ` [patch 2/9] VFS: check nanoseconds in utimensat miklos
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: miklos @ 2007-08-09 9:20 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel
[-- Attachment #1: unprivileged-mounts-fix-subtype.patch --]
[-- Type: text/plain, Size: 2714 bytes --]
From: Miklos Szeredi <mszeredi@suse.cz>
Subtype handling was done in do_kern_mount(), but "unprivileged
mounts: allow unprivileged mounts" patch made do_new_mount() use
vfs_kern_mount(). This broke the filesystem subtype handling.
Fix this by moving the subtype handling from do_kern_mount() into
do_new_mount(). All other callers are kernel-internal and do not need
subtype support.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
---
Index: linux/fs/namespace.c
===================================================================
--- linux.orig/fs/namespace.c 2007-08-09 11:01:55.000000000 +0200
+++ linux/fs/namespace.c 2007-08-09 11:04:15.000000000 +0200
@@ -1198,6 +1198,29 @@ out:
return err;
}
+static struct vfsmount *fs_set_subtype(struct vfsmount *mnt, const char *fstype)
+{
+ int err;
+ const char *subtype = strchr(fstype, '.');
+ if (subtype) {
+ subtype++;
+ err = -EINVAL;
+ if (!subtype[0])
+ goto err;
+ } else
+ subtype = "";
+
+ mnt->mnt_sb->s_subtype = kstrdup(subtype, GFP_KERNEL);
+ err = -ENOMEM;
+ if (!mnt->mnt_sb->s_subtype)
+ goto err;
+ return mnt;
+
+ err:
+ mntput(mnt);
+ return ERR_PTR(err);
+}
+
/*
* create a new mount for userspace and request it to be added into the
* namespace's tree
@@ -1227,6 +1250,9 @@ static int do_new_mount(struct nameidata
}
mnt = vfs_kern_mount(type, flags & ~MS_SETUSER, name, data);
+ if (!IS_ERR(mnt) && (type->fs_flags & FS_HAS_SUBTYPE) &&
+ !mnt->mnt_sb->s_subtype)
+ mnt = fs_set_subtype(mnt, fstype);
put_filesystem(type);
if (IS_ERR(mnt)) {
if (flags & MS_SETUSER)
Index: linux/fs/super.c
===================================================================
--- linux.orig/fs/super.c 2007-08-09 11:01:55.000000000 +0200
+++ linux/fs/super.c 2007-08-09 11:04:15.000000000 +0200
@@ -906,29 +906,6 @@ out:
EXPORT_SYMBOL_GPL(vfs_kern_mount);
-static struct vfsmount *fs_set_subtype(struct vfsmount *mnt, const char *fstype)
-{
- int err;
- const char *subtype = strchr(fstype, '.');
- if (subtype) {
- subtype++;
- err = -EINVAL;
- if (!subtype[0])
- goto err;
- } else
- subtype = "";
-
- mnt->mnt_sb->s_subtype = kstrdup(subtype, GFP_KERNEL);
- err = -ENOMEM;
- if (!mnt->mnt_sb->s_subtype)
- goto err;
- return mnt;
-
- err:
- mntput(mnt);
- return ERR_PTR(err);
-}
-
struct vfsmount *
do_kern_mount(const char *fstype, int flags, const char *name, void *data)
{
@@ -937,9 +914,6 @@ do_kern_mount(const char *fstype, int fl
if (!type)
return ERR_PTR(-ENODEV);
mnt = vfs_kern_mount(type, flags, name, data);
- if (!IS_ERR(mnt) && (type->fs_flags & FS_HAS_SUBTYPE) &&
- !mnt->mnt_sb->s_subtype)
- mnt = fs_set_subtype(mnt, fstype);
put_filesystem(type);
return mnt;
}
--
^ permalink raw reply [flat|nested] 10+ messages in thread* [patch 2/9] VFS: check nanoseconds in utimensat
2007-08-09 9:20 [patch 0/9] assorted fixes and cleanups miklos
2007-08-09 9:20 ` [patch 1/9] unprivileged mounts: fix subtype handling miklos
@ 2007-08-09 9:20 ` miklos
2007-08-09 9:20 ` [patch 3/9] fix execute checking in permission() miklos
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: miklos @ 2007-08-09 9:20 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, Ulrich Drepper
[-- Attachment #1: utimens_check_fix.patch --]
[-- Type: text/plain, Size: 1094 bytes --]
From: Miklos Szeredi <mszeredi@suse.cz>
utimensat() (and possibly other callers of do_utimes()) didn't check
if the nanosecond value was within the allowed range.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
---
Index: linux/fs/utimes.c
===================================================================
--- linux.orig/fs/utimes.c 2007-08-09 11:01:30.000000000 +0200
+++ linux/fs/utimes.c 2007-08-09 11:04:19.000000000 +0200
@@ -38,6 +38,14 @@ asmlinkage long sys_utime(char __user *f
#endif
+static bool nsec_valid(long nsec)
+{
+ if (nsec == UTIME_OMIT || nsec == UTIME_NOW)
+ return true;
+
+ return nsec >= 0 && nsec <= 999999999;
+}
+
/* If times==NULL, set access and modification to current time,
* must be owner or have write permission.
* Else, update from *times, must be owner or super user.
@@ -52,6 +60,11 @@ long do_utimes(int dfd, char __user *fil
struct file *f = NULL;
error = -EINVAL;
+ if (times && (!nsec_valid(times[0].tv_nsec) ||
+ !nsec_valid(times[1].tv_nsec))) {
+ goto out;
+ }
+
if (flags & ~AT_SYMLINK_NOFOLLOW)
goto out;
--
^ permalink raw reply [flat|nested] 10+ messages in thread* [patch 3/9] fix execute checking in permission()
2007-08-09 9:20 [patch 0/9] assorted fixes and cleanups miklos
2007-08-09 9:20 ` [patch 1/9] unprivileged mounts: fix subtype handling miklos
2007-08-09 9:20 ` [patch 2/9] VFS: check nanoseconds in utimensat miklos
@ 2007-08-09 9:20 ` miklos
2007-08-09 9:20 ` [patch 4/9] exec: remove unnecessary check for MNT_NOEXEC miklos
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: miklos @ 2007-08-09 9:20 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, Christoph Hellwig
[-- Attachment #1: permission_exec_fix.patch --]
[-- Type: text/plain, Size: 2515 bytes --]
From: Miklos Szeredi <mszeredi@suse.cz>
permission() checks that MAY_EXEC is only allowed on regular files if
at least one execute bit is set in the file mode.
generic_permission() already ensures this, so the extra check in
permission() is superfluous.
If the filesystem defines it's own ->permission() the check may still
be needed. In this case move it after ->permission(). This is needed
because filesystems such as FUSE may need to refresh the inode
attributes before checking permissions.
This check should be moved inside ->permission(), but that's another
story.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
---
Index: linux/fs/namei.c
===================================================================
--- linux.orig/fs/namei.c 2007-08-09 11:01:55.000000000 +0200
+++ linux/fs/namei.c 2007-08-09 11:04:22.000000000 +0200
@@ -227,10 +227,10 @@ int generic_permission(struct inode *ino
int permission(struct inode *inode, int mask, struct nameidata *nd)
{
- umode_t mode = inode->i_mode;
int retval, submask;
if (mask & MAY_WRITE) {
+ umode_t mode = inode->i_mode;
/*
* Nobody gets write access to a read-only fs.
@@ -246,22 +246,34 @@ int permission(struct inode *inode, int
return -EACCES;
}
-
- /*
- * MAY_EXEC on regular files requires special handling: We override
- * filesystem execute permissions if the mode bits aren't set or
- * the fs is mounted with the "noexec" flag.
- */
- if ((mask & MAY_EXEC) && S_ISREG(mode) && (!(mode & S_IXUGO) ||
- (nd && nd->mnt && (nd->mnt->mnt_flags & MNT_NOEXEC))))
- return -EACCES;
+ if ((mask & MAY_EXEC) && S_ISREG(inode->i_mode)) {
+ /*
+ * MAY_EXEC on regular files is denied if the fs is mounted
+ * with the "noexec" flag.
+ */
+ if (nd && nd->mnt && (nd->mnt->mnt_flags & MNT_NOEXEC))
+ return -EACCES;
+ }
/* Ordinary permission routines do not understand MAY_APPEND. */
submask = mask & ~MAY_APPEND;
- if (inode->i_op && inode->i_op->permission)
+ if (inode->i_op && inode->i_op->permission) {
retval = inode->i_op->permission(inode, submask, nd);
- else
+ if (!retval) {
+ /*
+ * Exec permission on a regular file is denied if none
+ * of the execute bits are set.
+ *
+ * This check should be done by the ->permission()
+ * method.
+ */
+ if ((mask & MAY_EXEC) && S_ISREG(inode->i_mode) &&
+ !(inode->i_mode & S_IXUGO))
+ return -EACCES;
+ }
+ } else {
retval = generic_permission(inode, submask, NULL);
+ }
if (retval)
return retval;
--
^ permalink raw reply [flat|nested] 10+ messages in thread* [patch 4/9] exec: remove unnecessary check for MNT_NOEXEC
2007-08-09 9:20 [patch 0/9] assorted fixes and cleanups miklos
` (2 preceding siblings ...)
2007-08-09 9:20 ` [patch 3/9] fix execute checking in permission() miklos
@ 2007-08-09 9:20 ` miklos
2007-08-09 9:20 ` [patch 5/9] fuse: fix setting i_mode bits miklos
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: miklos @ 2007-08-09 9:20 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, Christoph Hellwig
[-- Attachment #1: mnt_noexec_cleanup.patch --]
[-- Type: text/plain, Size: 1038 bytes --]
From: Miklos Szeredi <mszeredi@suse.cz>
vfs_permission(MAY_EXEC) checks if the filesystem is mounted with
"noexec", so there's no need to repeat this check in sys_uselib() and
open_exec().
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
---
Index: linux/fs/exec.c
===================================================================
--- linux.orig/fs/exec.c 2007-08-09 11:01:54.000000000 +0200
+++ linux/fs/exec.c 2007-08-09 11:04:24.000000000 +0200
@@ -113,9 +113,6 @@ asmlinkage long sys_uselib(const char __
if (error)
goto out;
- error = -EACCES;
- if (nd.mnt->mnt_flags & MNT_NOEXEC)
- goto exit;
error = -EINVAL;
if (!S_ISREG(nd.dentry->d_inode->i_mode))
goto exit;
@@ -659,8 +656,7 @@ struct file *open_exec(const char *name)
if (!err) {
struct inode *inode = nd.dentry->d_inode;
file = ERR_PTR(-EACCES);
- if (!(nd.mnt->mnt_flags & MNT_NOEXEC) &&
- S_ISREG(inode->i_mode)) {
+ if (S_ISREG(inode->i_mode)) {
int err = vfs_permission(&nd, MAY_EXEC);
file = ERR_PTR(err);
if (!err) {
--
^ permalink raw reply [flat|nested] 10+ messages in thread* [patch 5/9] fuse: fix setting i_mode bits
2007-08-09 9:20 [patch 0/9] assorted fixes and cleanups miklos
` (3 preceding siblings ...)
2007-08-09 9:20 ` [patch 4/9] exec: remove unnecessary check for MNT_NOEXEC miklos
@ 2007-08-09 9:20 ` miklos
2007-08-09 9:20 ` [patch 6/9] fuse: clean up execute permission checking miklos
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: miklos @ 2007-08-09 9:20 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel
[-- Attachment #1: fuse_mode_fix.patch --]
[-- Type: text/plain, Size: 1749 bytes --]
From: Miklos Szeredi <mszeredi@suse.cz>
The patch titled "fuse: fix permission checking on sticky directories"
removed all but the S_IFMT bits from i_mode.
However some of these are unfortunately used by the VFS, such as the
execute, suid and sgid bits.
So only remove the sticky bit, which is used for checking deletion
from a directory.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
---
Index: linux/fs/fuse/inode.c
===================================================================
--- linux.orig/fs/fuse/inode.c 2007-08-09 11:01:55.000000000 +0200
+++ linux/fs/fuse/inode.c 2007-08-09 11:04:26.000000000 +0200
@@ -124,14 +124,7 @@ void fuse_change_attributes(struct inode
loff_t oldsize;
inode->i_ino = attr->ino;
- fi->orig_i_mode = (inode->i_mode & S_IFMT) | (attr->mode & 07777);
- /*
- * Don't set the mode bits in i_mode, unless we want the VFS
- * to check permissions. This prevents failures due to the
- * sticky bit check in may_delete().
- */
- if (fc->flags & FUSE_DEFAULT_PERMISSIONS)
- inode->i_mode = fi->orig_i_mode;
+ inode->i_mode = (inode->i_mode & S_IFMT) | (attr->mode & 07777);
inode->i_nlink = attr->nlink;
inode->i_uid = attr->uid;
inode->i_gid = attr->gid;
@@ -143,6 +136,15 @@ void fuse_change_attributes(struct inode
inode->i_ctime.tv_sec = attr->ctime;
inode->i_ctime.tv_nsec = attr->ctimensec;
+ /*
+ * Don't set the sticky bit in i_mode, unless we want the VFS
+ * to check permissions. This prevents failures due to the
+ * check in may_delete().
+ */
+ fi->orig_i_mode = inode->i_mode;
+ if (!(fc->flags & FUSE_DEFAULT_PERMISSIONS))
+ inode->i_mode &= ~S_ISVTX;
+
spin_lock(&fc->lock);
oldsize = inode->i_size;
i_size_write(inode, attr->size);
--
^ permalink raw reply [flat|nested] 10+ messages in thread* [patch 6/9] fuse: clean up execute permission checking
2007-08-09 9:20 [patch 0/9] assorted fixes and cleanups miklos
` (4 preceding siblings ...)
2007-08-09 9:20 ` [patch 5/9] fuse: fix setting i_mode bits miklos
@ 2007-08-09 9:20 ` miklos
2007-08-09 9:20 ` [patch 7/9] clean out unused code in dentry pruning miklos
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: miklos @ 2007-08-09 9:20 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel
[-- Attachment #1: fuse_exec_permission_fix.patch --]
[-- Type: text/plain, Size: 3236 bytes --]
From: Miklos Szeredi <mszeredi@suse.cz>
Define a new function fuse_refresh_attributes() that conditionally
refreshes the attributes based on the validity timeout.
In fuse_permission() only refresh the attributes for checking the
execute bits if necessary.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
---
Index: linux/fs/fuse/dir.c
===================================================================
--- linux.orig/fs/fuse/dir.c 2007-08-09 11:01:55.000000000 +0200
+++ linux/fs/fuse/dir.c 2007-08-09 11:04:30.000000000 +0200
@@ -695,6 +695,20 @@ static int fuse_do_getattr(struct inode
}
/*
+ * Check if attributes are still valid, and if not send a GETATTR
+ * request to refresh them.
+ */
+static int fuse_refresh_attributes(struct inode *inode)
+{
+ struct fuse_inode *fi = get_fuse_inode(inode);
+
+ if (fi->i_time < get_jiffies_64())
+ return fuse_do_getattr(inode);
+ else
+ return 0;
+}
+
+/*
* Calling into a user-controlled filesystem gives the filesystem
* daemon ptrace-like capabilities over the requester process. This
* means, that the filesystem daemon is able to record the exact
@@ -770,7 +784,6 @@ static int fuse_access(struct inode *ino
static int fuse_permission(struct inode *inode, int mask, struct nameidata *nd)
{
struct fuse_conn *fc = get_fuse_conn(inode);
- struct fuse_inode *fi = get_fuse_inode(inode);
bool refreshed = false;
int err = 0;
@@ -778,12 +791,11 @@ static int fuse_permission(struct inode
return -EACCES;
/*
- * If attributes are needed, but are stale, refresh them
- * before proceeding
+ * If attributes are needed, refresh them before proceeding
*/
- if (((fc->flags & FUSE_DEFAULT_PERMISSIONS) || (mask & MAY_EXEC)) &&
- fi->i_time < get_jiffies_64()) {
- err = fuse_do_getattr(inode);
+ if ((fc->flags & FUSE_DEFAULT_PERMISSIONS) ||
+ ((mask & MAY_EXEC) && S_ISREG(inode->i_mode))) {
+ err = fuse_refresh_attributes(inode);
if (err)
return err;
@@ -806,14 +818,17 @@ static int fuse_permission(struct inode
exist. So if permissions are revoked this won't be
noticed immediately, only after the attribute
timeout has expired */
-
- } else {
- int mode = inode->i_mode;
- if ((mask & MAY_EXEC) && !S_ISDIR(mode) && !(mode & S_IXUGO))
- return -EACCES;
-
- if (nd && (nd->flags & (LOOKUP_ACCESS | LOOKUP_CHDIR)))
- return fuse_access(inode, mask);
+ } else if (nd && (nd->flags & (LOOKUP_ACCESS | LOOKUP_CHDIR))) {
+ err = fuse_access(inode, mask);
+ } else if ((mask & MAY_EXEC) && S_ISREG(inode->i_mode)) {
+ if (!(inode->i_mode & S_IXUGO)) {
+ if (refreshed)
+ return -EACCES;
+
+ err = fuse_do_getattr(inode);
+ if (!err && !(inode->i_mode & S_IXUGO))
+ return -EACCES;
+ }
}
return err;
}
@@ -1046,14 +1061,12 @@ static int fuse_getattr(struct vfsmount
struct inode *inode = entry->d_inode;
struct fuse_inode *fi = get_fuse_inode(inode);
struct fuse_conn *fc = get_fuse_conn(inode);
- int err = 0;
+ int err;
if (!fuse_allow_task(fc, current))
return -EACCES;
- if (fi->i_time < get_jiffies_64())
- err = fuse_do_getattr(inode);
-
+ err = fuse_refresh_attributes(inode);
if (!err) {
generic_fillattr(inode, stat);
stat->mode = fi->orig_i_mode;
--
^ permalink raw reply [flat|nested] 10+ messages in thread* [patch 7/9] clean out unused code in dentry pruning
2007-08-09 9:20 [patch 0/9] assorted fixes and cleanups miklos
` (5 preceding siblings ...)
2007-08-09 9:20 ` [patch 6/9] fuse: clean up execute permission checking miklos
@ 2007-08-09 9:20 ` miklos
2007-08-09 9:20 ` [patch 8/9] UML: remove unnecessary hostfs_getattr() miklos
2007-08-09 9:20 ` [patch 9/9] fix warnings is revoked_inode.c miklos
8 siblings, 0 replies; 10+ messages in thread
From: miklos @ 2007-08-09 9:20 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel
[-- Attachment #1: dcache_cleanup_prune.patch --]
[-- Type: text/plain, Size: 3176 bytes --]
From: Miklos Szeredi <mszeredi@suse.cz>
It looks like in the end all pruners want parents removed.
So remove unused code and function arguments.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
---
Index: linux/fs/dcache.c
===================================================================
--- linux.orig/fs/dcache.c 2007-08-09 11:01:54.000000000 +0200
+++ linux/fs/dcache.c 2007-08-09 11:04:32.000000000 +0200
@@ -381,20 +381,17 @@ restart:
* Throw away a dentry - free the inode, dput the parent. This requires that
* the LRU list has already been removed.
*
- * If prune_parents is true, try to prune ancestors as well.
+ * Try to prune ancestors as well. This is necessary to prevent
+ * quadratic behavior of shrink_dcache_parent(), but is also expected
+ * to be beneficial in reducing dentry cache fragmentation.
*
* Called with dcache_lock, drops it and then regains.
* Called with dentry->d_lock held, drops it.
*/
-static void prune_one_dentry(struct dentry * dentry, int prune_parents)
+static void prune_one_dentry(struct dentry * dentry)
{
__d_drop(dentry);
dentry = d_kill(dentry);
- if (!prune_parents) {
- dput(dentry);
- spin_lock(&dcache_lock);
- return;
- }
/*
* Prune ancestors. Locking is simpler than in dput(),
@@ -422,7 +419,6 @@ static void prune_one_dentry(struct dent
* @count: number of entries to try and free
* @sb: if given, ignore dentries for other superblocks
* which are being unmounted.
- * @prune_parents: if true, try to prune ancestors as well in one go
*
* Shrink the dcache. This is done when we need
* more memory, or simply when we need to unmount
@@ -433,7 +429,7 @@ static void prune_one_dentry(struct dent
* all the dentries are in use.
*/
-static void prune_dcache(int count, struct super_block *sb, int prune_parents)
+static void prune_dcache(int count, struct super_block *sb)
{
spin_lock(&dcache_lock);
for (; count ; count--) {
@@ -493,7 +489,7 @@ static void prune_dcache(int count, stru
* without taking the s_umount lock (I already hold it).
*/
if (sb && dentry->d_sb == sb) {
- prune_one_dentry(dentry, prune_parents);
+ prune_one_dentry(dentry);
continue;
}
/*
@@ -508,7 +504,7 @@ static void prune_dcache(int count, stru
s_umount = &dentry->d_sb->s_umount;
if (down_read_trylock(s_umount)) {
if (dentry->d_sb->s_root != NULL) {
- prune_one_dentry(dentry, prune_parents);
+ prune_one_dentry(dentry);
up_read(s_umount);
continue;
}
@@ -579,7 +575,7 @@ repeat:
spin_unlock(&dentry->d_lock);
continue;
}
- prune_one_dentry(dentry, 1);
+ prune_one_dentry(dentry);
cond_resched_lock(&dcache_lock);
goto repeat;
}
@@ -858,7 +854,7 @@ void shrink_dcache_parent(struct dentry
int found;
while ((found = select_parent(parent)) != 0)
- prune_dcache(found, parent->d_sb, 1);
+ prune_dcache(found, parent->d_sb);
}
/*
@@ -878,7 +874,7 @@ static int shrink_dcache_memory(int nr,
if (nr) {
if (!(gfp_mask & __GFP_FS))
return -1;
- prune_dcache(nr, NULL, 1);
+ prune_dcache(nr, NULL);
}
return (dentry_stat.nr_unused / 100) * sysctl_vfs_cache_pressure;
}
--
^ permalink raw reply [flat|nested] 10+ messages in thread* [patch 8/9] UML: remove unnecessary hostfs_getattr()
2007-08-09 9:20 [patch 0/9] assorted fixes and cleanups miklos
` (6 preceding siblings ...)
2007-08-09 9:20 ` [patch 7/9] clean out unused code in dentry pruning miklos
@ 2007-08-09 9:20 ` miklos
2007-08-09 9:20 ` [patch 9/9] fix warnings is revoked_inode.c miklos
8 siblings, 0 replies; 10+ messages in thread
From: miklos @ 2007-08-09 9:20 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, Jeff Dike
[-- Attachment #1: uml_hostfs_getattr_cleanup.patch --]
[-- Type: text/plain, Size: 1283 bytes --]
From: Miklos Szeredi <mszeredi@suse.cz>
Currently hostfs_getattr() just defines the default behavior.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
---
Index: linux/fs/hostfs/hostfs_kern.c
===================================================================
--- linux.orig/fs/hostfs/hostfs_kern.c 2007-08-09 11:01:55.000000000 +0200
+++ linux/fs/hostfs/hostfs_kern.c 2007-08-09 11:04:35.000000000 +0200
@@ -874,13 +874,6 @@ int hostfs_setattr(struct dentry *dentry
return inode_setattr(dentry->d_inode, attr);
}
-int hostfs_getattr(struct vfsmount *mnt, struct dentry *dentry,
- struct kstat *stat)
-{
- generic_fillattr(dentry->d_inode, stat);
- return 0;
-}
-
static const struct inode_operations hostfs_iops = {
.create = hostfs_create,
.link = hostfs_link,
@@ -892,7 +885,6 @@ static const struct inode_operations hos
.rename = hostfs_rename,
.permission = hostfs_permission,
.setattr = hostfs_setattr,
- .getattr = hostfs_getattr,
};
static const struct inode_operations hostfs_dir_iops = {
@@ -907,7 +899,6 @@ static const struct inode_operations hos
.rename = hostfs_rename,
.permission = hostfs_permission,
.setattr = hostfs_setattr,
- .getattr = hostfs_getattr,
};
int hostfs_link_readpage(struct file *file, struct page *page)
--
^ permalink raw reply [flat|nested] 10+ messages in thread* [patch 9/9] fix warnings is revoked_inode.c
2007-08-09 9:20 [patch 0/9] assorted fixes and cleanups miklos
` (7 preceding siblings ...)
2007-08-09 9:20 ` [patch 8/9] UML: remove unnecessary hostfs_getattr() miklos
@ 2007-08-09 9:20 ` miklos
8 siblings, 0 replies; 10+ messages in thread
From: miklos @ 2007-08-09 9:20 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, Nick Piggin
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: mm_fix_bothersome_warning.patch --]
[-- Type: text/plain, Size: 1549 bytes --]
From: Miklos Szeredi <mszeredi@suse.cz>
Fix following warnings introduced by
fs-introduce-write_begin-write_end-and-perform_write-aops-revoke.patch
fs/revoked_inode.c:381: warning: ‘revoked_write_begin’ defined but not used
fs/revoked_inode.c:388: warning: ‘revoked_write_end’ defined but not used
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
---
Index: linux/fs/revoked_inode.c
===================================================================
--- linux.orig/fs/revoked_inode.c 2007-08-09 11:01:55.000000000 +0200
+++ linux/fs/revoked_inode.c 2007-08-09 11:04:37.000000000 +0200
@@ -363,18 +363,6 @@ static int revoked_writepage(struct page
return -EIO;
}
-static int revoked_prepare_write(struct file *file, struct page *page,
- unsigned from, unsigned to)
-{
- return -EIO;
-}
-
-static int revoked_commit_write(struct file *file, struct page *page,
- unsigned from, unsigned to)
-{
- return -EIO;
-}
-
static int revoked_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned flags,
struct page **pagep, void **fsdata)
@@ -399,8 +387,8 @@ static ssize_t revoked_direct_IO(int rw,
static const struct address_space_operations revoked_aops = {
.readpage = revoked_readpage,
.writepage = revoked_writepage,
- .prepare_write = revoked_prepare_write,
- .commit_write = revoked_commit_write,
+ .write_begin = revoked_write_begin,
+ .write_end = revoked_write_end,
.direct_IO = revoked_direct_IO,
};
--
^ permalink raw reply [flat|nested] 10+ messages in thread