All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: Michael Richardson <mcr@sandelman.ca>
Cc: linux-kernel@vger.kernel.org, bart@jukie.net
Subject: Re: odd behavior from /sys/block (sysfs)
Date: Sat, 27 Nov 2010 10:58:29 -0800	[thread overview]
Message-ID: <20101127185829.GA19708@suse.de> (raw)
In-Reply-To: <5108.1290796566@marajade.sandelman.ca>

On Fri, Nov 26, 2010 at 01:36:06PM -0500, Michael Richardson wrote:
> 
> {please CC me}
> 
> I was capturing data from my laptop's /sys file system as test input
> for some code that needs to grovel through /sys a bit.  I found it weird
> that tar got different answers than ls!  See below (at end) for original
> observation.
> 
> It seems that this is because lstat64() on sysfs returns st_size=0 for
> the link, and tar does not know how to deal with this, while ls does.
> I don't know if it is tar that is wrong, or sysfs.
> lstat64(3) suggests that it is sysfs that is at fault, that it should
> set st_size.  The behaviour of ls, suggests that perhaps other systems
> have worked around st_size=0 for symlinks.  (I'm on 2.6.32-bpo.5 from debian)

So, what do you think should be changed here?

I wouldn't ever recommend using tar on sysfs as it doesn't make any
sense (sysfs is a virtual file system, like /proc/ and I think that tar
doesn't like /proc either, right?)

thanks,

greg k-h

  reply	other threads:[~2010-11-27 18:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-26 18:36 odd behavior from /sys/block (sysfs) Michael Richardson
2010-11-27 18:58 ` Greg KH [this message]
2010-11-27 21:14   ` Michael Richardson
2010-11-30 17:36     ` Greg KH

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=20101127185829.GA19708@suse.de \
    --to=gregkh@suse.de \
    --cc=bart@jukie.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcr@sandelman.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.