All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: "Stéphane Doyon" <s.doyon@videotron.ca>
Cc: linux-mtd@lists.infradead.org
Subject: Re: Truncated symlink on jffs2
Date: Thu, 27 Dec 2001 11:51:03 +0000	[thread overview]
Message-ID: <13913.1009453863@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0112240846510.15627-100000@odo.ds9.ufp>

s.doyon@videotron.ca said:
>  where lstat is a tiny program that does lstat(argv[1], &st) and
> printf("size: %lu\n", st.st_size);. It outputs 0, but it should say 6
> (which it does on a symlink created on another fs). 

> Is this a bug or a known limitation? 

Bug. Thanks for pointing it out. We should be setting i_size. Something like
this ought to do it for _new_ symlinks, although we should probably contrive
a hack for jffs2_read_inode() to make it dtrt on older filesystems too:

===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/dir.c,v
retrieving revision 1.44
diff -u -r1.44 dir.c
--- fs/jffs2/dir.c	2001/11/06 17:58:41	1.44
+++ fs/jffs2/dir.c	2001/12/27 11:50:08
@@ -542,7 +542,7 @@
 
 	f = JFFS2_INODE_INFO(inode);
 
-	ri->dsize = ri->csize = strlen(target);
+	ri->isize = ri->dsize = ri->csize = strlen(target);
 	ri->totlen = sizeof(*ri) + ri->dsize;
 	ri->hdr_crc = crc32(0, ri, sizeof(struct jffs2_unknown_node)-4);
 



--
dwmw2

  reply	other threads:[~2001-12-27 11:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-24 14:15 Truncated symlink on jffs2 Stéphane Doyon
2001-12-27 11:51 ` David Woodhouse [this message]
2001-12-27 22:51   ` Stéphane Doyon
2001-12-27 22:59     ` David Woodhouse

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=13913.1009453863@redhat.com \
    --to=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=s.doyon@videotron.ca \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.