[PATCH] devfs symlinks incompatible with cpio

From: Jeremy Fitzhardinge (jeremy@goop.org)
Date: Thu Apr 13 2000 - 13:24:13 EST


Hi,

I tried to use cpio rather than tar to save the state of /dev, but it
failed on all the symlinks. The reason is pretty simple:

lstat("/dev/ide/hd/c0b0t0u0p5", {st_mode=S_IFLNK|0555, st_size=0, ...}) =0
                                                               ^
readlink("/dev/ide/hd/c0b0t0u0p5", 0x8055de0, 0) = -1 EINVAL
                                              ^

Fix attached.

        J


--- 2.3/fs/devfs/base.c Wed Apr 12 16:08:50 2000
+++ local-2.3/fs/devfs/base.c Thu Apr 13 11:05:27 2000
@@ -2228,6 +2228,9 @@
         inode->i_fop = &devfs_fops;
     } else if (S_ISLNK(di->mode)) {
         inode->i_op = &devfs_symlink_iops;
+
+ if (di->de->registered)
+ inode->i_size = strlen(di->de->u.symlink.linkname);
     } else {
         inode->i_fop = &devfs_fops;
     }

End of MIME message

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:22 EST