summaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-10-05 01:18:40 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-10-05 01:18:40 +0000
commit012bb3e61e5eced6c610f9e036372bf0c8def2d1 (patch)
tree87efc733f9b164e8c85c0336f92c8fb7eff6d183 /fs/open.c
parent625a1589d3d6464b5d90b8a0918789e3afffd220 (diff)
Merge with Linux 2.4.0-test9. Please check DECstation, I had a number
of rejects to fixup while integrating Linus patches. I also found that this kernel will only boot SMP on Origin; the UP kernel freeze soon after bootup with SCSI timeout messages. I commit this anyway since I found that the last CVS versions had the same problem.
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/open.c b/fs/open.c
index 0f1787025..ac2077f1f 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -10,11 +10,14 @@
#include <linux/file.h>
#include <linux/smp_lock.h>
#include <linux/quotaops.h>
+#include <linux/dnotify.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <asm/uaccess.h>
+#define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))
+
int vfs_statfs(struct super_block *sb, struct statfs *buf)
{
int retval = -ENODEV;
@@ -115,6 +118,13 @@ static inline long do_sys_truncate(const char * path, loff_t length)
if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
goto dput_and_out;
+ /*
+ * Make sure that there are no leases.
+ */
+ error = get_lease(inode, FMODE_WRITE);
+ if (error)
+ goto dput_and_out;
+
error = get_write_access(inode);
if (error)
goto dput_and_out;
@@ -314,7 +324,8 @@ asmlinkage long sys_access(const char * filename, int mode)
if (!res) {
res = permission(nd.dentry->d_inode, mode);
/* SuS v2 requires we report a read only fs too */
- if(!res && (mode & S_IWOTH) && IS_RDONLY(nd.dentry->d_inode))
+ if(!res && (mode & S_IWOTH) && IS_RDONLY(nd.dentry->d_inode)
+ && !special_file(nd.dentry->d_inode->i_mode))
res = -EROFS;
path_release(&nd);
}
@@ -790,6 +801,7 @@ int filp_close(struct file *filp, fl_owner_t id)
retval = filp->f_op->flush(filp);
unlock_kernel();
}
+ fcntl_dirnotify(0, filp, 0);
locks_remove_posix(filp, id);
fput(filp);
return retval;