From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: top stack (l)users for 2.5.67
Date: Mon, 14 Apr 2003 19:46:45 +0200 [thread overview]
Message-ID: <20030414174645.GK10347@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <1050338275.25353.93.camel@dhcp22.swansea.linux.org.uk>
On Mon, 14 April 2003 17:37:55 +0100, Alan Cox wrote:
> On Llu, 2003-04-14 at 18:30, Jörn Engel wrote:
> > Is intermezzo still actively maintained? I submitted patches for those
> > two presto-functions several weeks ago and didn't notice any feedback.
>
> I've found the maintainers slow but its not their major project any
> more. Feed them into -ac if you want
Sure, the below was against 2.5.64 and applies cleanly to .67.
Jörn
--
Do not stop an army on its way home.
-- Sun Tzu
--- linux-2.5.64/fs/intermezzo/journal.c Mon Feb 24 20:05:05 2003
+++ linux-2.5.64-i2o/fs/intermezzo/journal.c Fri Mar 14 17:37:18 2003
@@ -1239,12 +1239,15 @@
return izo_rcvd_write(fset, &rec);
}
+/* FIXME: should the below go into some header file? */
+#define PRESTO_COPY_KML_TAIL_BUFSIZE 4096
struct file * presto_copy_kml_tail(struct presto_file_set *fset,
unsigned long int start)
{
struct file *f;
int len;
loff_t read_off, write_off, bytes;
+ char *buf;
ENTRY;
@@ -1255,15 +1258,18 @@
return f;
}
+ buf = kmalloc(PRESTO_COPY_KML_TAIL_BUFSIZE, GFP_KERNEL);
+ if (!buf)
+ return ERR_PTR(-ENOMEM);
+
write_off = 0;
read_off = start;
bytes = fset->fset_kml.fd_offset - start;
while (bytes > 0) {
- char buf[4096];
int toread;
- if (bytes > sizeof(buf))
- toread = sizeof(buf);
+ if (bytes > PRESTO_COPY_KML_TAIL_BUFSIZE)
+ toread = PRESTO_COPY_KML_TAIL_BUFSIZE;
else
toread = bytes;
@@ -1274,6 +1280,7 @@
if (presto_fwrite(f, buf, len, &write_off) != len) {
filp_close(f, NULL);
+ kfree(buf);
EXIT;
return ERR_PTR(-EIO);
}
@@ -1281,6 +1288,7 @@
bytes -= len;
}
+ kfree(buf);
EXIT;
return f;
}
@@ -1584,12 +1592,14 @@
return error;
}
+/* FIXME: should the below go into some header file? */
+#define PRESTO_GET_FILEID_BUFSIZE 4096
int presto_get_fileid(int minor, struct presto_file_set *fset,
struct dentry *dentry)
{
int opcode = KML_OPCODE_GET_FILEID;
struct rec_info rec;
- char *buffer, *path, *logrecord, record[4096]; /*include path*/
+ char *buffer, *path, *logrecord, *record; /*include path*/
struct dentry *root;
__u32 uid, gid, pathlen;
int error, size;
@@ -1597,6 +1607,10 @@
ENTRY;
+ record = kmalloc(PRESTO_GET_FILEID_BUFSIZE, GFP_KERNEL);
+ if (!record)
+ return -ENOMEM;
+
root = fset->fset_dentry;
uid = cpu_to_le32(dentry->d_inode->i_uid);
@@ -1610,7 +1624,7 @@
sizeof(struct kml_suffix);
CDEBUG(D_FILE, "kml size: %d\n", size);
- if ( size > sizeof(record) )
+ if ( size > PRESTO_GET_FILEID_BUFSIZE )
CERROR("InterMezzo: BUFFER OVERFLOW in %s!\n", __FUNCTION__);
memset(&rec, 0, sizeof(rec));
@@ -1633,6 +1647,7 @@
fset->fset_name);
BUFF_FREE(buffer);
+ kfree(record);
EXIT;
return error;
}
next prev parent reply other threads:[~2003-04-14 17:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-14 17:30 Jörn Engel
2003-04-14 16:37 ` Alan Cox
2003-04-14 17:46 ` Jörn Engel [this message]
2003-04-14 18:25 ` Dave Jones
2003-04-14 19:05 ` Jörn Engel
2003-04-14 19:18 ` Andreas Dilger
2003-04-14 19:40 ` Jörn Engel
2003-04-15 15:38 ` Peter Braam
2003-04-15 9:08 ` Jörn Engel
2003-04-14 19:38 ` Randy.Dunlap
2003-04-14 19:44 ` Jörn Engel
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=20030414174645.GK10347@wohnheim.fh-wedel.de \
--to=joern@wohnheim.fh-wedel.de \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®