From: Matthew Wilcox <willy@debian.org>
To: intermezzo-devel@lists.sf.net
Cc: linux-fsdevel@vger.kernel.org
Subject: [PATCH] Intermezzo should call vfs_permission
Date: Fri, 31 Oct 2003 13:20:24 +0000 [thread overview]
Message-ID: <20031031132024.GS25237@parcelfarce.linux.theplanet.co.uk> (raw)
This patch fixes some extremely naughty behaviour by intermezzo where it
overrides a member of an inode's i_op -- which is probably shared between
all inodes of that filesystem type! It turns out that the intended
behaviour is accomplished equally well by just calling vfs_permission().
Index: fs/intermezzo/dir.c
===================================================================
RCS file: /var/cvs/linux-2.6/fs/intermezzo/dir.c,v
retrieving revision 1.12
diff -u -p -r1.12 dir.c
--- a/fs/intermezzo/dir.c 8 Oct 2003 20:52:46 -0000 1.12
+++ b/fs/intermezzo/dir.c 31 Oct 2003 03:10:01 -0000
@@ -835,10 +835,9 @@ int presto_permission(struct inode *inod
{
unsigned short mode = inode->i_mode;
struct presto_cache *cache;
- int rc;
ENTRY;
- if ( presto_can_ilookup() && !(mask & S_IWOTH)) {
+ if (presto_can_ilookup() && !(mask & S_IWOTH)) {
CDEBUG(D_CACHE, "ilookup on %ld OK\n", inode->i_ino);
EXIT;
return 0;
@@ -861,18 +860,8 @@ int presto_permission(struct inode *inod
}
}
- /* The cache filesystem doesn't have its own permission function,
- * but we don't want to duplicate the VFS code here. In order
- * to avoid looping from permission calling this function again,
- * we temporarily override the permission operation while we call
- * the VFS permission function.
- */
- inode->i_op->permission = NULL;
- rc = permission(inode, mask, nd);
- inode->i_op->permission = &presto_permission;
-
EXIT;
- return rc;
+ return vfs_permission(inode, mask);
}
--
"It's not Hollywood. War is real, war is primarily not about defeat or
victory, it is about death. I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk
next reply other threads:[~2003-10-31 13:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-31 13:20 Matthew Wilcox [this message]
2003-11-11 1:51 ` What calls setattr? Charles Manning
2003-11-11 1:57 ` viro
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=20031031132024.GS25237@parcelfarce.linux.theplanet.co.uk \
--to=willy@debian.org \
--cc=intermezzo-devel@lists.sf.net \
--cc=linux-fsdevel@vger.kernel.org \
/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