* [Xen-devel] Re: [PATCH] shorten the x86_64 boot setup GDT to what the comment says
From: Jan Beulich @ 2006-11-09 15:31 UTC (permalink / raw)
To: Steven Rostedt, Andi Kleen; +Cc: herbert, xen-devel, LKML
In-Reply-To: <200611091413.21415.ak@suse.de>
>>> Andi Kleen <ak@suse.de> 09.11.06 14:13 >>>
>
>> Stephen Tweedie has written up a patch to fix the Xen side and will be
>> submitting that to those folks. But that doesn't excuse the GDT limit
>> being a magnitude too big.
>
>Added thanks
Once at this - why not set it to the *correct* value, just like i386 does,
and update the comment at once? Namely, why would you expect to
never run into the original problem again if there are still possible
selectors pointing into invalid, yet within limits parts of the GDT?
Jan
^ permalink raw reply
* [Cluster-devel] cluster/gfs2/edit gfs2hex.c hexedit.c hexedit.h
From: rpeterso @ 2006-11-09 15:31 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: rpeterso at sourceware.org 2006-11-09 15:31:01
Modified files:
gfs2/edit : gfs2hex.c hexedit.c hexedit.h
Log message:
This is the fix for Bugzilla Bug 214621: Allow gfs2_edit to view,
print and edit gfs(1) file systems.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/edit/gfs2hex.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.5&r2=1.5.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/edit/hexedit.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.6&r2=1.6.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/edit/hexedit.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4&r2=1.4.2.1
--- cluster/gfs2/edit/gfs2hex.c 2006/08/09 20:21:59 1.5
+++ cluster/gfs2/edit/gfs2hex.c 2006/11/09 15:31:01 1.5.2.1
@@ -201,7 +201,8 @@
{
unsigned int x, y;
uint64_t p, last;
- int isdir = !!(S_ISDIR(di->di_mode));
+ int isdir = !!(S_ISDIR(di->di_mode)) ||
+ (gfs1 && di->__pad1 == GFS_FILE_DIR);
indirect_blocks = 0;
memset(&indirect, 0, sizeof(indirect));
@@ -400,11 +401,20 @@
pv(sb, sb_bsize, "%u", "0x%x");
pv(sb, sb_bsize_shift, "%u", "0x%x");
- gfs2_inum_print2("master dir", &sb->sb_master_dir);
+ if (gfs1) {
+ gfs2_inum_print2("jindex ino", &sbd1->sb_jindex_di);
+ gfs2_inum_print2("rindex ino", &sbd1->sb_rindex_di);
+ }
+ else
+ gfs2_inum_print2("master dir", &sb->sb_master_dir);
gfs2_inum_print2("root dir ", &sb->sb_root_dir);
pv(sb, sb_lockproto, "%s", NULL);
pv(sb, sb_locktable, "%s", NULL);
+ if (gfs1) {
+ gfs2_inum_print2("quota ino ", &gfs1_quota_di);
+ gfs2_inum_print2("license ", &gfs1_license_di);
+ }
}
/******************************************************************************
--- cluster/gfs2/edit/hexedit.c 2006/08/09 20:21:59 1.6
+++ cluster/gfs2/edit/hexedit.c 2006/11/09 15:31:01 1.6.2.1
@@ -36,7 +36,6 @@
#define EXTERN
#include "hexedit.h"
-#include "linux/gfs2_ondisk.h"
#include "linux_endian.h"
#include "libgfs2.h"
#include "gfs2hex.h"
@@ -286,6 +285,7 @@
move(line++, 0);
printw("Other commands:");
gfs2instr(" h","This Help display");
+ gfs2instr(" c","Toggle the color scheme");
gfs2instr(" m","Switch display mode: hex -> GFS2 structure -> Extended");
gfs2instr(" q","Quit (same as hitting <escape> key)");
gfs2instr("<enter>","Edit a value (enter to save, esc to discard)");
@@ -346,7 +346,10 @@
switch (*(lpBuffer+7)) {
case GFS2_METATYPE_SB: /* 1 */
print_gfs2("(superblock)");
- struct_len = sizeof(struct gfs2_sb);
+ if (gfs1)
+ struct_len = sizeof(struct gfs_sb);
+ else
+ struct_len = sizeof(struct gfs2_sb);
break;
case GFS2_METATYPE_RG: /* 2 */
print_gfs2("(rsrc grp hdr)");
@@ -410,25 +413,37 @@
}
if (block == sbd.sd_sb.sb_root_dir.no_addr)
print_gfs2("-------------------- Root direcory -------------------");
- else if (block == sbd.sd_sb.sb_master_dir.no_addr)
+ else if (!gfs1 && block == sbd.sd_sb.sb_master_dir.no_addr)
print_gfs2("------------------- Master directory -----------------");
else {
- int d;
+ if (gfs1) {
+ if (block == sbd1->sb_rindex_di.no_addr)
+ print_gfs2("--------------------- rindex file -------------------");
+ else if (block == gfs1_quota_di.no_addr)
+ print_gfs2("--------------------- Quota file --------------------");
+ else if (block == sbd1->sb_jindex_di.no_addr)
+ print_gfs2("-------------------- Journal Index ------------------");
+ else if (block == gfs1_license_di.no_addr)
+ print_gfs2("-------------------- License file -------------------");
+ }
+ else {
+ int d;
- for (d = 2; d < 8; d++) {
- if (block == masterdir.dirent[d].block) {
- if (!strncmp(masterdir.dirent[d].filename, "jindex", 6))
- print_gfs2("-------------------- Journal Index ------------------");
- else if (!strncmp(masterdir.dirent[d].filename, "per_node", 8))
- print_gfs2("-------------------- Per-node Dir -------------------");
- else if (!strncmp(masterdir.dirent[d].filename, "inum", 4))
- print_gfs2("--------------------- Inum file ---------------------");
- else if (!strncmp(masterdir.dirent[d].filename, "statfs", 6))
- print_gfs2("--------------------- statfs file -------------------");
- else if (!strncmp(masterdir.dirent[d].filename, "rindex", 6))
- print_gfs2("--------------------- rindex file -------------------");
- else if (!strncmp(masterdir.dirent[d].filename, "quota", 5))
- print_gfs2("--------------------- Quota file --------------------");
+ for (d = 2; d < 8; d++) {
+ if (block == masterdir.dirent[d].block) {
+ if (!strncmp(masterdir.dirent[d].filename, "jindex", 6))
+ print_gfs2("-------------------- Journal Index ------------------");
+ else if (!strncmp(masterdir.dirent[d].filename, "per_node", 8))
+ print_gfs2("-------------------- Per-node Dir -------------------");
+ else if (!strncmp(masterdir.dirent[d].filename, "inum", 4))
+ print_gfs2("--------------------- Inum file ---------------------");
+ else if (!strncmp(masterdir.dirent[d].filename, "statfs", 6))
+ print_gfs2("--------------------- statfs file -------------------");
+ else if (!strncmp(masterdir.dirent[d].filename, "rindex", 6))
+ print_gfs2("--------------------- rindex file -------------------");
+ else if (!strncmp(masterdir.dirent[d].filename, "quota", 5))
+ print_gfs2("--------------------- Quota file --------------------");
+ }
}
}
}
@@ -513,6 +528,11 @@
eol(0);
l+=16;
} /* while */
+ if (gfs1) {
+ COLORS_NORMAL;
+ print_gfs2(" *** This seems to be a GFS-1 file system ***");
+ eol(0);
+ }
return (offset+len);
}/* hexdump */
@@ -634,7 +654,8 @@
eol(0);
start_line = line;
if (indirect_blocks ||
- (gfs2_struct_type == GFS2_METATYPE_DI && S_ISDIR(di.di_mode))) {
+ (gfs2_struct_type == GFS2_METATYPE_DI &&
+ (S_ISDIR(di.di_mode) || (gfs1 && di.__pad1 == GFS_FILE_DIR)))) {
indir_blocks = indirect_blocks;
if (!indirect_blocks) {
print_gfs2("This directory contains %d directory entries.",
@@ -754,7 +775,8 @@
else
print_gfs2("This block does not have indirect blocks.");
eol(0);
- if (block == masterblock("rindex")) {
+ if ((gfs1 && block == sbd1->sb_rindex_di.no_addr) ||
+ (block == masterblock("rindex"))) {
struct gfs2_buffer_head *tmp_bh;
tmp_bh = bread(&sbd, block);
@@ -762,7 +784,7 @@
print_rindex(tmp_inode);
brelse(tmp_bh, not_updated);
}
- else if (block == masterblock("inum")) {
+ else if (!gfs1 && block == masterblock("inum")) {
struct gfs2_buffer_head *tmp_bh;
tmp_bh = bread(&sbd, block);
@@ -770,7 +792,7 @@
print_inum(tmp_inode);
brelse(tmp_bh, not_updated);
}
- else if (block == masterblock("statfs")) {
+ else if (!gfs1 && block == masterblock("statfs")) {
struct gfs2_buffer_head *tmp_bh;
tmp_bh = bread(&sbd, block);
@@ -778,7 +800,8 @@
print_statfs(tmp_inode);
brelse(tmp_bh, not_updated);
}
- else if (block == masterblock("quota")) {
+ else if ((gfs1 && block == gfs1_quota_di.no_addr) ||
+ (block == masterblock("quota"))) {
struct gfs2_buffer_head *tmp_bh;
tmp_bh = bread(&sbd, block);
@@ -796,6 +819,7 @@
{
int x;
+ sbd1 = (struct gfs_sb *)&sbd.sd_sb;
ioctl(fd, BLKFLSBUF, 0);
do_lseek(fd, 0x10 * bufsize);
do_read(fd, buf, bufsize); /* read in the desired block */
@@ -813,6 +837,20 @@
osi_list_init(&sbd.buf_hash[x]);
compute_constants(&sbd);
gfs2_sb_in(&sbd.sd_sb, buf); /* parse it out into the sb structure */
+ /* Check to see if this is really gfs1 */
+ if (sbd1->sb_fs_format == GFS_FORMAT_FS &&
+ sbd1->sb_header.mh_type == GFS_METATYPE_SB &&
+ sbd1->sb_header.mh_format == GFS_FORMAT_SB &&
+ sbd1->sb_multihost_format == GFS_FORMAT_MULTI) {
+ struct gfs_sb *sbbuf = (struct gfs_sb *)buf;
+
+ gfs1 = TRUE;
+ gfs2_inum_in(&sbd1->sb_rindex_di, (void *)&sbbuf->sb_rindex_di);
+ gfs2_inum_in(&gfs1_quota_di, (void *)&sbbuf->sb_quota_di);
+ gfs2_inum_in(&gfs1_license_di, (void *)&sbbuf->sb_license_di);
+ }
+ else
+ gfs1 = FALSE;
}
/* ------------------------------------------------------------------------ */
@@ -938,10 +976,20 @@
if (bobgets(string, 1, 7, 16)) {
if (!strcmp(string,"root"))
temp_blk = sbd.sd_sb.sb_root_dir.no_addr;
- else if (!strcmp(string,"master"))
+ else if (!gfs1 && !strcmp(string,"master"))
temp_blk = sbd.sd_sb.sb_master_dir.no_addr;
- else if (isalpha(string[0]))
- temp_blk = masterblock(string);
+ else if (isalpha(string[0])) {
+ if (gfs1) {
+ if (!strcmp(string, "jindex"))
+ temp_blk = sbd1->sb_jindex_di.no_addr;
+ else if (!strcmp(string, "rindex"))
+ temp_blk = sbd1->sb_rindex_di.no_addr;
+ else if (!strcmp(string, "quota"))
+ temp_blk = gfs1_quota_di.no_addr;
+ }
+ else
+ temp_blk = masterblock(string);
+ }
else if (string[0] == '0' && string[1] == 'x')
sscanf(string, "%"SCNx64, &temp_blk); /* retrieve in hex */
else
@@ -957,6 +1005,32 @@
}
/* ------------------------------------------------------------------------ */
+/* init_colors */
+/* ------------------------------------------------------------------------ */
+void init_colors()
+{
+
+ if (color_scheme) {
+ init_pair(COLOR_TITLE, COLOR_BLACK, COLOR_CYAN); /* title lines */
+ init_pair(COLOR_NORMAL, COLOR_WHITE, COLOR_BLACK); /* normal text */
+ init_pair(COLOR_INVERSE, COLOR_BLACK, COLOR_WHITE); /* inverse text */
+ init_pair(COLOR_SPECIAL, COLOR_RED, COLOR_BLACK); /* special text */
+ init_pair(COLOR_HIGHLIGHT, COLOR_GREEN, COLOR_BLACK); /* highlighted */
+ init_pair(COLOR_OFFSETS, COLOR_CYAN, COLOR_BLACK); /* offsets */
+ init_pair(COLOR_CONTENTS, COLOR_YELLOW, COLOR_BLACK); /* file data */
+ }
+ else {
+ init_pair(COLOR_TITLE, COLOR_BLACK, COLOR_CYAN); /* title lines */
+ init_pair(COLOR_NORMAL, COLOR_BLACK, COLOR_WHITE); /* normal text */
+ init_pair(COLOR_INVERSE, COLOR_WHITE, COLOR_BLACK); /* inverse text */
+ init_pair(COLOR_SPECIAL, COLOR_RED, COLOR_WHITE); /* special text */
+ init_pair(COLOR_HIGHLIGHT, COLOR_GREEN, COLOR_WHITE); /* highlighted */
+ init_pair(COLOR_OFFSETS, COLOR_CYAN, COLOR_WHITE); /* offsets */
+ init_pair(COLOR_CONTENTS, COLOR_BLUE, COLOR_WHITE); /* file data */
+ }
+}
+
+/* ------------------------------------------------------------------------ */
/* interactive_mode - accept keystrokes from user and display structures */
/* ------------------------------------------------------------------------ */
void interactive_mode(void)
@@ -980,24 +1054,7 @@
keypad(stdscr, TRUE);
raw();
curs_set(0);
- if (color_scheme) {
- init_pair(COLOR_TITLE, COLOR_BLACK, COLOR_CYAN); /* title lines */
- init_pair(COLOR_NORMAL, COLOR_WHITE, COLOR_BLACK); /* normal text */
- init_pair(COLOR_INVERSE, COLOR_BLACK, COLOR_WHITE); /* inverse text */
- init_pair(COLOR_SPECIAL, COLOR_RED, COLOR_BLACK); /* special text */
- init_pair(COLOR_HIGHLIGHT, COLOR_GREEN, COLOR_BLACK); /* highlighted */
- init_pair(COLOR_OFFSETS, COLOR_CYAN, COLOR_BLACK); /* offsets */
- init_pair(COLOR_CONTENTS, COLOR_YELLOW, COLOR_BLACK); /* file data */
- }
- else {
- init_pair(COLOR_TITLE, COLOR_BLACK, COLOR_CYAN); /* title lines */
- init_pair(COLOR_NORMAL, COLOR_BLACK, COLOR_WHITE); /* normal text */
- init_pair(COLOR_INVERSE, COLOR_WHITE, COLOR_BLACK); /* inverse text */
- init_pair(COLOR_SPECIAL, COLOR_RED, COLOR_WHITE); /* special text */
- init_pair(COLOR_HIGHLIGHT, COLOR_GREEN, COLOR_WHITE); /* highlighted */
- init_pair(COLOR_OFFSETS, COLOR_CYAN, COLOR_WHITE); /* offsets */
- init_pair(COLOR_CONTENTS, COLOR_BLUE, COLOR_WHITE); /* file data */
- }
+ init_colors();
/* Accept keystrokes and act on them accordingly */
Quit = FALSE;
while (!Quit) {
@@ -1128,6 +1185,13 @@
offset = 0;
break;
/* -------------------------------------------------------------- */
+ /* c - Change color scheme */
+ /* -------------------------------------------------------------- */
+ case 'c':
+ color_scheme = !color_scheme;
+ init_colors();
+ break;
+ /* -------------------------------------------------------------- */
/* page up key */
/* -------------------------------------------------------------- */
case 0x19: // ctrl-y for vt100
@@ -1295,6 +1359,7 @@
exit(0);
}
else if (!strcasecmp(argv[i], "-h") ||
+ !strcasecmp(argv[i], "-help") ||
!strcasecmp(argv[i], "-usage")) {
usage();
exit(0);
@@ -1303,7 +1368,8 @@
i++;
color_scheme = atoi(argv[i]);
}
- else if (!strcasecmp(argv[i], "-p")) {
+ else if (!strcasecmp(argv[i], "-p") ||
+ !strcasecmp(argv[i], "-print")) {
termlines = 0; /* initial value--we'll figure it out later */
display_mode = GFS2_MODE;
}
@@ -1323,24 +1389,39 @@
else if (!strcmp(argv[i], "size"))
printf("Device size: %" PRIu64 " (0x%" PRIx64 ")\n",
max_block, max_block);
- else if (!strcmp(argv[i], "sb"))
+ else if (!strcmp(argv[i], "sb") ||
+ !strcmp(argv[i], "superblock"))
push_block(0x10); /* superblock */
- else if (!strcmp(argv[i], "root"))
+ else if (!strcmp(argv[i], "root") ||
+ !strcmp(argv[i], "rootdir"))
push_block(sbd.sd_sb.sb_root_dir.no_addr);
- else if (!strcmp(argv[i], "master"))
+ else if (!gfs1 && !strcmp(argv[i], "master"))
push_block(sbd.sd_sb.sb_master_dir.no_addr);
- else if (!strcmp(argv[i], "jindex"))
- push_block(masterblock("jindex"));/* journal index */
- else if (!strcmp(argv[i], "per_node"))
+ else if (!strcmp(argv[i], "jindex")) {
+ if (gfs1)
+ push_block(sbd1->sb_jindex_di.no_addr);
+ else
+ push_block(masterblock("jindex"));/* journal index */
+ }
+ else if (!gfs1 && !strcmp(argv[i], "per_node"))
push_block(masterblock("per_node"));
- else if (!strcmp(argv[i], "inum"))
+ else if (!gfs1 && !strcmp(argv[i], "inum"))
push_block(masterblock("inum"));
- else if (!strcmp(argv[i], "statfs"))
+ else if (!gfs1 && !strcmp(argv[i], "statfs"))
push_block(masterblock("statfs"));
- else if (!strcmp(argv[i], "rindex"))
- push_block(masterblock("rindex"));
- else if (!strcmp(argv[i], "quota"))
- push_block(masterblock("quota"));
+ else if (!strcmp(argv[i], "rindex") ||
+ !strcmp(argv[i], "rgindex")) {
+ if (gfs1)
+ push_block(sbd1->sb_rindex_di.no_addr);
+ else
+ push_block(masterblock("rindex"));
+ }
+ else if (!strcmp(argv[i], "quota")) {
+ if (gfs1)
+ push_block(gfs1_quota_di.no_addr);
+ else
+ push_block(masterblock("quota"));
+ }
else if (argv[i][0]=='0' && argv[i][1]=='x') { /* hex addr */
sscanf(argv[i], "%"SCNx64, &temp_blk);/* retrieve in hex */
push_block(temp_blk);
@@ -1401,7 +1482,8 @@
max_block = lseek(fd, 0, SEEK_END) / bufsize;
read_superblock();
- read_master_dir();
+ if (!gfs1)
+ read_master_dir();
block_in_mem = -1;
if (!termlines) /* if printing to stdout */
process_parameters(argc, argv, 1); /* get what to print from cmdline */
--- cluster/gfs2/edit/hexedit.h 2006/06/19 20:49:25 1.4
+++ cluster/gfs2/edit/hexedit.h 2006/11/09 15:31:01 1.4.2.1
@@ -43,6 +43,20 @@
enum dsp_mode { HEX_MODE = 0, GFS2_MODE = 1, EXTENDED_MODE = 2 };
#define BLOCK_STACK_SIZE 256
+#define GFS_FORMAT_SB (100) /* Super-Block */
+#define GFS_METATYPE_SB (1) /* Super-Block */
+#define GFS_FORMAT_FS (1309) /* Filesystem (all-encompassing) */
+#define GFS_FORMAT_MULTI (1401) /* Multi-Host */
+/* GFS1 Dinode types */
+#define GFS_FILE_NON (0)
+#define GFS_FILE_REG (1) /* regular file */
+#define GFS_FILE_DIR (2) /* directory */
+#define GFS_FILE_LNK (5) /* link */
+#define GFS_FILE_BLK (7) /* block device node */
+#define GFS_FILE_CHR (8) /* character device node */
+#define GFS_FILE_FIFO (101) /* fifo/pipe */
+#define GFS_FILE_SOCK (102) /* socket */
+
EXTERN char *prog_name;
EXTERN int fd;
EXTERN uint64_t block INIT(0);
@@ -66,6 +80,9 @@
EXTERN int edit_size[DISPLAY_MODES], edit_last[DISPLAY_MODES];
EXTERN char edit_string[1024], edit_fmt[80];
EXTERN struct gfs2_sbd sbd;
+EXTERN struct gfs_sb *sbd1;
+EXTERN struct gfs2_inum gfs1_quota_di; /* kludge because gfs2 sb too small */
+EXTERN struct gfs2_inum gfs1_license_di; /* kludge because gfs2 sb too small */
EXTERN struct gfs2_dinode di;
EXTERN int screen_chunk_size INIT(512); /* how much of the 4K can fit on screen */
EXTERN int gfs2_struct_type;
@@ -74,6 +91,7 @@
EXTERN int identify INIT(FALSE);
EXTERN int color_scheme INIT(0);
EXTERN WINDOW *wind;
+EXTERN int gfs1 INIT(0);
struct gfs2_dirents {
uint64_t block;
@@ -95,6 +113,35 @@
enum dsp_mode display_mode;
};
+struct gfs_sb {
+ /* Order is important; need to be able to read old superblocks
+ in order to support on-disk version upgrades */
+ struct gfs2_meta_header sb_header;
+
+ uint32_t sb_fs_format; /* GFS_FORMAT_FS (on-disk version) */
+ uint32_t sb_multihost_format; /* GFS_FORMAT_MULTI */
+ uint32_t sb_flags; /* ?? */
+
+ uint32_t sb_bsize; /* fundamental FS block size in bytes */
+ uint32_t sb_bsize_shift; /* log2(sb_bsize) */
+ uint32_t sb_seg_size; /* Journal segment size in FS blocks */
+
+ /* These special inodes do not appear in any on-disk directory. */
+ struct gfs2_inum sb_jindex_di; /* journal index inode */
+ struct gfs2_inum sb_rindex_di; /* resource group index inode */
+ struct gfs2_inum sb_root_di; /* root directory inode */
+
+ /* Default inter-node locking protocol (lock module) and namespace */
+ char sb_lockproto[GFS2_LOCKNAME_LEN]; /* lock protocol name */
+ char sb_locktable[GFS2_LOCKNAME_LEN]; /* unique name for this FS */
+
+ /* More special inodes */
+ struct gfs2_inum sb_quota_di; /* quota inode */
+ struct gfs2_inum sb_license_di; /* license inode */
+
+ char sb_reserved[96];
+};
+
EXTERN struct blkstack_info blockstack[BLOCK_STACK_SIZE];
EXTERN struct indirect_info indirect[512]; /* more than the most indirect
pointers possible for any given
^ permalink raw reply
* [Xen-devel] Re: [PATCH] shorten the x86_64 boot setup GDT to what the comment says
From: Jan Beulich @ 2006-11-09 15:31 UTC (permalink / raw)
To: Steven Rostedt, Andi Kleen; +Cc: herbert, xen-devel, LKML
In-Reply-To: <200611091413.21415.ak@suse.de>
>>> Andi Kleen <ak@suse.de> 09.11.06 14:13 >>>
>
>> Stephen Tweedie has written up a patch to fix the Xen side and will be
>> submitting that to those folks. But that doesn't excuse the GDT limit
>> being a magnitude too big.
>
>Added thanks
Once at this - why not set it to the *correct* value, just like i386 does,
and update the comment at once? Namely, why would you expect to
never run into the original problem again if there are still possible
selectors pointing into invalid, yet within limits parts of the GDT?
Jan
^ permalink raw reply
* [Cluster-devel] cluster/gfs2/edit gfs2hex.c hexedit.c hexedit.h
From: rpeterso @ 2006-11-09 15:29 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: rpeterso at sourceware.org 2006-11-09 15:29:45
Modified files:
gfs2/edit : gfs2hex.c hexedit.c hexedit.h
Log message:
This is the fix for Bugzilla Bug 214621: Allow gfs2_edit to view,
print and edit gfs(1) file systems.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/edit/gfs2hex.c.diff?cvsroot=cluster&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/edit/hexedit.c.diff?cvsroot=cluster&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/edit/hexedit.h.diff?cvsroot=cluster&r1=1.4&r2=1.5
--- cluster/gfs2/edit/gfs2hex.c 2006/08/09 20:21:59 1.5
+++ cluster/gfs2/edit/gfs2hex.c 2006/11/09 15:29:45 1.6
@@ -201,7 +201,8 @@
{
unsigned int x, y;
uint64_t p, last;
- int isdir = !!(S_ISDIR(di->di_mode));
+ int isdir = !!(S_ISDIR(di->di_mode)) ||
+ (gfs1 && di->__pad1 == GFS_FILE_DIR);
indirect_blocks = 0;
memset(&indirect, 0, sizeof(indirect));
@@ -400,11 +401,20 @@
pv(sb, sb_bsize, "%u", "0x%x");
pv(sb, sb_bsize_shift, "%u", "0x%x");
- gfs2_inum_print2("master dir", &sb->sb_master_dir);
+ if (gfs1) {
+ gfs2_inum_print2("jindex ino", &sbd1->sb_jindex_di);
+ gfs2_inum_print2("rindex ino", &sbd1->sb_rindex_di);
+ }
+ else
+ gfs2_inum_print2("master dir", &sb->sb_master_dir);
gfs2_inum_print2("root dir ", &sb->sb_root_dir);
pv(sb, sb_lockproto, "%s", NULL);
pv(sb, sb_locktable, "%s", NULL);
+ if (gfs1) {
+ gfs2_inum_print2("quota ino ", &gfs1_quota_di);
+ gfs2_inum_print2("license ", &gfs1_license_di);
+ }
}
/******************************************************************************
--- cluster/gfs2/edit/hexedit.c 2006/08/09 20:21:59 1.6
+++ cluster/gfs2/edit/hexedit.c 2006/11/09 15:29:45 1.7
@@ -36,7 +36,6 @@
#define EXTERN
#include "hexedit.h"
-#include "linux/gfs2_ondisk.h"
#include "linux_endian.h"
#include "libgfs2.h"
#include "gfs2hex.h"
@@ -286,6 +285,7 @@
move(line++, 0);
printw("Other commands:");
gfs2instr(" h","This Help display");
+ gfs2instr(" c","Toggle the color scheme");
gfs2instr(" m","Switch display mode: hex -> GFS2 structure -> Extended");
gfs2instr(" q","Quit (same as hitting <escape> key)");
gfs2instr("<enter>","Edit a value (enter to save, esc to discard)");
@@ -346,7 +346,10 @@
switch (*(lpBuffer+7)) {
case GFS2_METATYPE_SB: /* 1 */
print_gfs2("(superblock)");
- struct_len = sizeof(struct gfs2_sb);
+ if (gfs1)
+ struct_len = sizeof(struct gfs_sb);
+ else
+ struct_len = sizeof(struct gfs2_sb);
break;
case GFS2_METATYPE_RG: /* 2 */
print_gfs2("(rsrc grp hdr)");
@@ -410,25 +413,37 @@
}
if (block == sbd.sd_sb.sb_root_dir.no_addr)
print_gfs2("-------------------- Root direcory -------------------");
- else if (block == sbd.sd_sb.sb_master_dir.no_addr)
+ else if (!gfs1 && block == sbd.sd_sb.sb_master_dir.no_addr)
print_gfs2("------------------- Master directory -----------------");
else {
- int d;
+ if (gfs1) {
+ if (block == sbd1->sb_rindex_di.no_addr)
+ print_gfs2("--------------------- rindex file -------------------");
+ else if (block == gfs1_quota_di.no_addr)
+ print_gfs2("--------------------- Quota file --------------------");
+ else if (block == sbd1->sb_jindex_di.no_addr)
+ print_gfs2("-------------------- Journal Index ------------------");
+ else if (block == gfs1_license_di.no_addr)
+ print_gfs2("-------------------- License file -------------------");
+ }
+ else {
+ int d;
- for (d = 2; d < 8; d++) {
- if (block == masterdir.dirent[d].block) {
- if (!strncmp(masterdir.dirent[d].filename, "jindex", 6))
- print_gfs2("-------------------- Journal Index ------------------");
- else if (!strncmp(masterdir.dirent[d].filename, "per_node", 8))
- print_gfs2("-------------------- Per-node Dir -------------------");
- else if (!strncmp(masterdir.dirent[d].filename, "inum", 4))
- print_gfs2("--------------------- Inum file ---------------------");
- else if (!strncmp(masterdir.dirent[d].filename, "statfs", 6))
- print_gfs2("--------------------- statfs file -------------------");
- else if (!strncmp(masterdir.dirent[d].filename, "rindex", 6))
- print_gfs2("--------------------- rindex file -------------------");
- else if (!strncmp(masterdir.dirent[d].filename, "quota", 5))
- print_gfs2("--------------------- Quota file --------------------");
+ for (d = 2; d < 8; d++) {
+ if (block == masterdir.dirent[d].block) {
+ if (!strncmp(masterdir.dirent[d].filename, "jindex", 6))
+ print_gfs2("-------------------- Journal Index ------------------");
+ else if (!strncmp(masterdir.dirent[d].filename, "per_node", 8))
+ print_gfs2("-------------------- Per-node Dir -------------------");
+ else if (!strncmp(masterdir.dirent[d].filename, "inum", 4))
+ print_gfs2("--------------------- Inum file ---------------------");
+ else if (!strncmp(masterdir.dirent[d].filename, "statfs", 6))
+ print_gfs2("--------------------- statfs file -------------------");
+ else if (!strncmp(masterdir.dirent[d].filename, "rindex", 6))
+ print_gfs2("--------------------- rindex file -------------------");
+ else if (!strncmp(masterdir.dirent[d].filename, "quota", 5))
+ print_gfs2("--------------------- Quota file --------------------");
+ }
}
}
}
@@ -513,6 +528,11 @@
eol(0);
l+=16;
} /* while */
+ if (gfs1) {
+ COLORS_NORMAL;
+ print_gfs2(" *** This seems to be a GFS-1 file system ***");
+ eol(0);
+ }
return (offset+len);
}/* hexdump */
@@ -634,7 +654,8 @@
eol(0);
start_line = line;
if (indirect_blocks ||
- (gfs2_struct_type == GFS2_METATYPE_DI && S_ISDIR(di.di_mode))) {
+ (gfs2_struct_type == GFS2_METATYPE_DI &&
+ (S_ISDIR(di.di_mode) || (gfs1 && di.__pad1 == GFS_FILE_DIR)))) {
indir_blocks = indirect_blocks;
if (!indirect_blocks) {
print_gfs2("This directory contains %d directory entries.",
@@ -754,7 +775,8 @@
else
print_gfs2("This block does not have indirect blocks.");
eol(0);
- if (block == masterblock("rindex")) {
+ if ((gfs1 && block == sbd1->sb_rindex_di.no_addr) ||
+ (block == masterblock("rindex"))) {
struct gfs2_buffer_head *tmp_bh;
tmp_bh = bread(&sbd, block);
@@ -762,7 +784,7 @@
print_rindex(tmp_inode);
brelse(tmp_bh, not_updated);
}
- else if (block == masterblock("inum")) {
+ else if (!gfs1 && block == masterblock("inum")) {
struct gfs2_buffer_head *tmp_bh;
tmp_bh = bread(&sbd, block);
@@ -770,7 +792,7 @@
print_inum(tmp_inode);
brelse(tmp_bh, not_updated);
}
- else if (block == masterblock("statfs")) {
+ else if (!gfs1 && block == masterblock("statfs")) {
struct gfs2_buffer_head *tmp_bh;
tmp_bh = bread(&sbd, block);
@@ -778,7 +800,8 @@
print_statfs(tmp_inode);
brelse(tmp_bh, not_updated);
}
- else if (block == masterblock("quota")) {
+ else if ((gfs1 && block == gfs1_quota_di.no_addr) ||
+ (block == masterblock("quota"))) {
struct gfs2_buffer_head *tmp_bh;
tmp_bh = bread(&sbd, block);
@@ -796,6 +819,7 @@
{
int x;
+ sbd1 = (struct gfs_sb *)&sbd.sd_sb;
ioctl(fd, BLKFLSBUF, 0);
do_lseek(fd, 0x10 * bufsize);
do_read(fd, buf, bufsize); /* read in the desired block */
@@ -813,6 +837,20 @@
osi_list_init(&sbd.buf_hash[x]);
compute_constants(&sbd);
gfs2_sb_in(&sbd.sd_sb, buf); /* parse it out into the sb structure */
+ /* Check to see if this is really gfs1 */
+ if (sbd1->sb_fs_format == GFS_FORMAT_FS &&
+ sbd1->sb_header.mh_type == GFS_METATYPE_SB &&
+ sbd1->sb_header.mh_format == GFS_FORMAT_SB &&
+ sbd1->sb_multihost_format == GFS_FORMAT_MULTI) {
+ struct gfs_sb *sbbuf = (struct gfs_sb *)buf;
+
+ gfs1 = TRUE;
+ gfs2_inum_in(&sbd1->sb_rindex_di, (void *)&sbbuf->sb_rindex_di);
+ gfs2_inum_in(&gfs1_quota_di, (void *)&sbbuf->sb_quota_di);
+ gfs2_inum_in(&gfs1_license_di, (void *)&sbbuf->sb_license_di);
+ }
+ else
+ gfs1 = FALSE;
}
/* ------------------------------------------------------------------------ */
@@ -938,10 +976,20 @@
if (bobgets(string, 1, 7, 16)) {
if (!strcmp(string,"root"))
temp_blk = sbd.sd_sb.sb_root_dir.no_addr;
- else if (!strcmp(string,"master"))
+ else if (!gfs1 && !strcmp(string,"master"))
temp_blk = sbd.sd_sb.sb_master_dir.no_addr;
- else if (isalpha(string[0]))
- temp_blk = masterblock(string);
+ else if (isalpha(string[0])) {
+ if (gfs1) {
+ if (!strcmp(string, "jindex"))
+ temp_blk = sbd1->sb_jindex_di.no_addr;
+ else if (!strcmp(string, "rindex"))
+ temp_blk = sbd1->sb_rindex_di.no_addr;
+ else if (!strcmp(string, "quota"))
+ temp_blk = gfs1_quota_di.no_addr;
+ }
+ else
+ temp_blk = masterblock(string);
+ }
else if (string[0] == '0' && string[1] == 'x')
sscanf(string, "%"SCNx64, &temp_blk); /* retrieve in hex */
else
@@ -957,6 +1005,32 @@
}
/* ------------------------------------------------------------------------ */
+/* init_colors */
+/* ------------------------------------------------------------------------ */
+void init_colors()
+{
+
+ if (color_scheme) {
+ init_pair(COLOR_TITLE, COLOR_BLACK, COLOR_CYAN); /* title lines */
+ init_pair(COLOR_NORMAL, COLOR_WHITE, COLOR_BLACK); /* normal text */
+ init_pair(COLOR_INVERSE, COLOR_BLACK, COLOR_WHITE); /* inverse text */
+ init_pair(COLOR_SPECIAL, COLOR_RED, COLOR_BLACK); /* special text */
+ init_pair(COLOR_HIGHLIGHT, COLOR_GREEN, COLOR_BLACK); /* highlighted */
+ init_pair(COLOR_OFFSETS, COLOR_CYAN, COLOR_BLACK); /* offsets */
+ init_pair(COLOR_CONTENTS, COLOR_YELLOW, COLOR_BLACK); /* file data */
+ }
+ else {
+ init_pair(COLOR_TITLE, COLOR_BLACK, COLOR_CYAN); /* title lines */
+ init_pair(COLOR_NORMAL, COLOR_BLACK, COLOR_WHITE); /* normal text */
+ init_pair(COLOR_INVERSE, COLOR_WHITE, COLOR_BLACK); /* inverse text */
+ init_pair(COLOR_SPECIAL, COLOR_RED, COLOR_WHITE); /* special text */
+ init_pair(COLOR_HIGHLIGHT, COLOR_GREEN, COLOR_WHITE); /* highlighted */
+ init_pair(COLOR_OFFSETS, COLOR_CYAN, COLOR_WHITE); /* offsets */
+ init_pair(COLOR_CONTENTS, COLOR_BLUE, COLOR_WHITE); /* file data */
+ }
+}
+
+/* ------------------------------------------------------------------------ */
/* interactive_mode - accept keystrokes from user and display structures */
/* ------------------------------------------------------------------------ */
void interactive_mode(void)
@@ -980,24 +1054,7 @@
keypad(stdscr, TRUE);
raw();
curs_set(0);
- if (color_scheme) {
- init_pair(COLOR_TITLE, COLOR_BLACK, COLOR_CYAN); /* title lines */
- init_pair(COLOR_NORMAL, COLOR_WHITE, COLOR_BLACK); /* normal text */
- init_pair(COLOR_INVERSE, COLOR_BLACK, COLOR_WHITE); /* inverse text */
- init_pair(COLOR_SPECIAL, COLOR_RED, COLOR_BLACK); /* special text */
- init_pair(COLOR_HIGHLIGHT, COLOR_GREEN, COLOR_BLACK); /* highlighted */
- init_pair(COLOR_OFFSETS, COLOR_CYAN, COLOR_BLACK); /* offsets */
- init_pair(COLOR_CONTENTS, COLOR_YELLOW, COLOR_BLACK); /* file data */
- }
- else {
- init_pair(COLOR_TITLE, COLOR_BLACK, COLOR_CYAN); /* title lines */
- init_pair(COLOR_NORMAL, COLOR_BLACK, COLOR_WHITE); /* normal text */
- init_pair(COLOR_INVERSE, COLOR_WHITE, COLOR_BLACK); /* inverse text */
- init_pair(COLOR_SPECIAL, COLOR_RED, COLOR_WHITE); /* special text */
- init_pair(COLOR_HIGHLIGHT, COLOR_GREEN, COLOR_WHITE); /* highlighted */
- init_pair(COLOR_OFFSETS, COLOR_CYAN, COLOR_WHITE); /* offsets */
- init_pair(COLOR_CONTENTS, COLOR_BLUE, COLOR_WHITE); /* file data */
- }
+ init_colors();
/* Accept keystrokes and act on them accordingly */
Quit = FALSE;
while (!Quit) {
@@ -1128,6 +1185,13 @@
offset = 0;
break;
/* -------------------------------------------------------------- */
+ /* c - Change color scheme */
+ /* -------------------------------------------------------------- */
+ case 'c':
+ color_scheme = !color_scheme;
+ init_colors();
+ break;
+ /* -------------------------------------------------------------- */
/* page up key */
/* -------------------------------------------------------------- */
case 0x19: // ctrl-y for vt100
@@ -1295,6 +1359,7 @@
exit(0);
}
else if (!strcasecmp(argv[i], "-h") ||
+ !strcasecmp(argv[i], "-help") ||
!strcasecmp(argv[i], "-usage")) {
usage();
exit(0);
@@ -1303,7 +1368,8 @@
i++;
color_scheme = atoi(argv[i]);
}
- else if (!strcasecmp(argv[i], "-p")) {
+ else if (!strcasecmp(argv[i], "-p") ||
+ !strcasecmp(argv[i], "-print")) {
termlines = 0; /* initial value--we'll figure it out later */
display_mode = GFS2_MODE;
}
@@ -1323,24 +1389,39 @@
else if (!strcmp(argv[i], "size"))
printf("Device size: %" PRIu64 " (0x%" PRIx64 ")\n",
max_block, max_block);
- else if (!strcmp(argv[i], "sb"))
+ else if (!strcmp(argv[i], "sb") ||
+ !strcmp(argv[i], "superblock"))
push_block(0x10); /* superblock */
- else if (!strcmp(argv[i], "root"))
+ else if (!strcmp(argv[i], "root") ||
+ !strcmp(argv[i], "rootdir"))
push_block(sbd.sd_sb.sb_root_dir.no_addr);
- else if (!strcmp(argv[i], "master"))
+ else if (!gfs1 && !strcmp(argv[i], "master"))
push_block(sbd.sd_sb.sb_master_dir.no_addr);
- else if (!strcmp(argv[i], "jindex"))
- push_block(masterblock("jindex"));/* journal index */
- else if (!strcmp(argv[i], "per_node"))
+ else if (!strcmp(argv[i], "jindex")) {
+ if (gfs1)
+ push_block(sbd1->sb_jindex_di.no_addr);
+ else
+ push_block(masterblock("jindex"));/* journal index */
+ }
+ else if (!gfs1 && !strcmp(argv[i], "per_node"))
push_block(masterblock("per_node"));
- else if (!strcmp(argv[i], "inum"))
+ else if (!gfs1 && !strcmp(argv[i], "inum"))
push_block(masterblock("inum"));
- else if (!strcmp(argv[i], "statfs"))
+ else if (!gfs1 && !strcmp(argv[i], "statfs"))
push_block(masterblock("statfs"));
- else if (!strcmp(argv[i], "rindex"))
- push_block(masterblock("rindex"));
- else if (!strcmp(argv[i], "quota"))
- push_block(masterblock("quota"));
+ else if (!strcmp(argv[i], "rindex") ||
+ !strcmp(argv[i], "rgindex")) {
+ if (gfs1)
+ push_block(sbd1->sb_rindex_di.no_addr);
+ else
+ push_block(masterblock("rindex"));
+ }
+ else if (!strcmp(argv[i], "quota")) {
+ if (gfs1)
+ push_block(gfs1_quota_di.no_addr);
+ else
+ push_block(masterblock("quota"));
+ }
else if (argv[i][0]=='0' && argv[i][1]=='x') { /* hex addr */
sscanf(argv[i], "%"SCNx64, &temp_blk);/* retrieve in hex */
push_block(temp_blk);
@@ -1401,7 +1482,8 @@
max_block = lseek(fd, 0, SEEK_END) / bufsize;
read_superblock();
- read_master_dir();
+ if (!gfs1)
+ read_master_dir();
block_in_mem = -1;
if (!termlines) /* if printing to stdout */
process_parameters(argc, argv, 1); /* get what to print from cmdline */
--- cluster/gfs2/edit/hexedit.h 2006/06/19 20:49:25 1.4
+++ cluster/gfs2/edit/hexedit.h 2006/11/09 15:29:45 1.5
@@ -43,6 +43,20 @@
enum dsp_mode { HEX_MODE = 0, GFS2_MODE = 1, EXTENDED_MODE = 2 };
#define BLOCK_STACK_SIZE 256
+#define GFS_FORMAT_SB (100) /* Super-Block */
+#define GFS_METATYPE_SB (1) /* Super-Block */
+#define GFS_FORMAT_FS (1309) /* Filesystem (all-encompassing) */
+#define GFS_FORMAT_MULTI (1401) /* Multi-Host */
+/* GFS1 Dinode types */
+#define GFS_FILE_NON (0)
+#define GFS_FILE_REG (1) /* regular file */
+#define GFS_FILE_DIR (2) /* directory */
+#define GFS_FILE_LNK (5) /* link */
+#define GFS_FILE_BLK (7) /* block device node */
+#define GFS_FILE_CHR (8) /* character device node */
+#define GFS_FILE_FIFO (101) /* fifo/pipe */
+#define GFS_FILE_SOCK (102) /* socket */
+
EXTERN char *prog_name;
EXTERN int fd;
EXTERN uint64_t block INIT(0);
@@ -66,6 +80,9 @@
EXTERN int edit_size[DISPLAY_MODES], edit_last[DISPLAY_MODES];
EXTERN char edit_string[1024], edit_fmt[80];
EXTERN struct gfs2_sbd sbd;
+EXTERN struct gfs_sb *sbd1;
+EXTERN struct gfs2_inum gfs1_quota_di; /* kludge because gfs2 sb too small */
+EXTERN struct gfs2_inum gfs1_license_di; /* kludge because gfs2 sb too small */
EXTERN struct gfs2_dinode di;
EXTERN int screen_chunk_size INIT(512); /* how much of the 4K can fit on screen */
EXTERN int gfs2_struct_type;
@@ -74,6 +91,7 @@
EXTERN int identify INIT(FALSE);
EXTERN int color_scheme INIT(0);
EXTERN WINDOW *wind;
+EXTERN int gfs1 INIT(0);
struct gfs2_dirents {
uint64_t block;
@@ -95,6 +113,35 @@
enum dsp_mode display_mode;
};
+struct gfs_sb {
+ /* Order is important; need to be able to read old superblocks
+ in order to support on-disk version upgrades */
+ struct gfs2_meta_header sb_header;
+
+ uint32_t sb_fs_format; /* GFS_FORMAT_FS (on-disk version) */
+ uint32_t sb_multihost_format; /* GFS_FORMAT_MULTI */
+ uint32_t sb_flags; /* ?? */
+
+ uint32_t sb_bsize; /* fundamental FS block size in bytes */
+ uint32_t sb_bsize_shift; /* log2(sb_bsize) */
+ uint32_t sb_seg_size; /* Journal segment size in FS blocks */
+
+ /* These special inodes do not appear in any on-disk directory. */
+ struct gfs2_inum sb_jindex_di; /* journal index inode */
+ struct gfs2_inum sb_rindex_di; /* resource group index inode */
+ struct gfs2_inum sb_root_di; /* root directory inode */
+
+ /* Default inter-node locking protocol (lock module) and namespace */
+ char sb_lockproto[GFS2_LOCKNAME_LEN]; /* lock protocol name */
+ char sb_locktable[GFS2_LOCKNAME_LEN]; /* unique name for this FS */
+
+ /* More special inodes */
+ struct gfs2_inum sb_quota_di; /* quota inode */
+ struct gfs2_inum sb_license_di; /* license inode */
+
+ char sb_reserved[96];
+};
+
EXTERN struct blkstack_info blockstack[BLOCK_STACK_SIZE];
EXTERN struct indirect_info indirect[512]; /* more than the most indirect
pointers possible for any given
^ permalink raw reply
* Re: [PATCH] shorten the x86_64 boot setup GDT to what the comment says
From: Alexander van Heukelum @ 2006-11-09 15:44 UTC (permalink / raw)
To: Steven Rostedt; +Cc: LKML, sct, ak, herbert, xen-devel
In-Reply-To: <Pine.LNX.4.58.0611091016100.6250@gandalf.stny.rr.com>
On Thu, Nov 09, 2006 at 10:18:53AM -0500, Steven Rostedt wrote:
> Hmm, Andi,
>
> Should this be more like what is done in x86? Although this isn't a major
> bug or anything, would it be cleaner. For example doing:
>
> @@ -836,11 +836,15 @@ gdt:
> .word 0x9200 # data read/write
> .word 0x00CF # granularity = 4096, 386
> # (+5th nibble of limit)
> +gdt_end:
> + .align 4
> +
> + .word 0 # alignment byte
> idt_48:
> .word 0 # idt limit = 0
> .word 0, 0 # idt base = 0L
> gdt_48:
> - .word 0x8000 # gdt limit=2048,
> + .word gdt_end - gdt - 1 # gdt limit=2048,
> # 256 GDT entries
>
> .word 0, 0 # gdt base (filled in
>
> instead?
Hi!
Maybe you should consider 16-byte aligning the gdt table too, like
i386 does? It doesn't hurt, and as per the comment in the i386-file
"16 byte aligment is recommended by intel."
Greetings,
Alexander van Heukelum
> If so, I can send you another patch that does this. Will need to test it
> first.
>
> -- Steve
^ permalink raw reply
* problem with alsa on Sony UX-90s
From: Matthias Lemke @ 2006-11-09 15:28 UTC (permalink / raw)
To: alsa-devel
Hello,
i tried the last days linux on a sony UX90.
It is a very small notebook computer.
Sound works perfekt with headphones, but the internal speaker does not
his job.
I use als 1.0.13.
from dmesg:
[17179590.068000] hda_codec: Unknown model for ALC262, trying auto-probe
from BIOS...
loaded modules:
snd_seq_midi 9984 0
snd_rawmidi 27136 1 snd_seq_midi
snd_seq_midi_event 8960 2 snd_seq_oss,snd_seq_midi
snd_seq 59632 6
snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq_midi_event
snd_timer 24964 2 snd_pcm,snd_seq
snd_seq_device 9868 5
snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_rawmidi,snd_seq
shpchp 42144 0
pci_hotplug 32828 1 shpchp
snd 60548 14
snd_hda_intel,snd_hda_codec,snd_pcm_oss,snd_pcm,snd_mixer_oss,snd_seq_dummy,snd_seq_oss,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
soundcore 11232 1 snd
snd_page_alloc 11656 2 snd_hda_intel,snd_pcm
cat /proc/asound/cards
0 [Intel ]: HDA-Intel - HDA Intel
HDA Intel at 0xd4340000 irq 66
head -3 /proc/asound/card0/codec*
Codec: Realtek ALC262
Address: 0
Vendor Id: 0x10ec0262
sina@ux90s:/proc/asound$
any ideas?
regards
matthias
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply
* MPC82xx : ECC and PCI problem
From: Laurent Lagrange @ 2006-11-09 15:11 UTC (permalink / raw)
To: 'Laurent Lagrange'; +Cc: linuxppc-embedded
Hello,
I work on a custom monarch PMC MPC82xx board.
This board embeds an ECC device which can be enabled or disabled.
When ECC is disabled all PCI accesses work fine.
When ECC is enabled and PCI disabled, all work fine.
But when ECC and PCI are enabled, the first PCI accesses give the following
:
>>>
Linux/PPC load: devfs=mount rootfstype=tmpfs root=/dev/ram rw
Uncompressing Linux...done.
Now booting the kernel
Linux version 2.6.9-xxx (version gcc 3.2.3) #1 Thu Feb 16 12:02:39 CET 2006
Built 1 zonelists
Kernel command line: devfs=mount rootfstype=tmpfs root=/dev/ram rw
PID hash table entries: 1024 (order: 10, 16384 bytes)
Warning: real time clock seems stuck!
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 123904k available (1072k kernel code, 368k data, 72k init, 0k
highmem)
Calibrating delay loop... 177.15 BogoMIPS (lpj=88576)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
NET: Registered protocol family 16
PCI: Probing PCI hardware
Machine check in kernel mode.
Caused by (from SRR1=81032): Machine check signal
Oops: machine check, sig: 7 [#1]
NIP: C00137DC LR: C0013820 SP: C0491E40 REGS: c0491d90 TRAP: 0200 Not
tainted
MSR: 00081032 EE: 0 PR: 0 FP: 0 ME: 1 IR/DR: 11
TASK = c08fcba0[1] 'swapper' THREAD: c0490000Last syscall: 120
GPR00: C008ECE8 C0491E40 C08FCBA0 00000000 00000000 FF010906 00000001
C0491E78
GPR08: 2F9DEB58 00000002 00000800 FF010904 C02B21DC 00015710 FDFFFFFF
FF010000
GPR16: FFFF7FFF EFFFDFFF 00200000 FFF7FFFF 00000000 BFFFEDBF 00000000
80000000
GPR24: 00000000 FFFFFF7E 00000000 00000001 C0491E98 00009032 C04A3280
C04A3280
NIP [c00137dc] indirect_read_config+0xc8/0x11c
LR [c0013820] indirect_read_config+0x10c/0x11c
Call trace:
[c008ece8] pci_bus_read_config_byte+0x40/0x60
[c01648a4] pci_scan_device+0x24/0x198
[c0164a30] pci_scan_single_device+0x18/0x70
[c0164ab8] pci_scan_slot+0x30/0x98
[c0164b4c] pci_scan_child_bus+0x2c/0xd0
[c0164db0] pci_scan_bus_parented+0x184/0x198
[c015e488] pcibios_init+0x64/0x134
[c015a87c] do_initcalls+0x5c/0xfc
[c015a93c] do_basic_setup+0x20/0x30
[c0003a08] init+0x2c/0xf0
[c000aae4] kernel_thread+0x44/0x60
Kernel panic - not syncing: Attempted to kill init!
<0>Rebooting in 180 seconds..
>>>
Has anyone encountered same problems ?
Relationships between ECC, PCI, cache ?
Any idea would be welcome
Thanks all
Laurent
^ permalink raw reply
* Re: [PATCH] [XEN-API] Support for vTPM management API in Xend
From: Ewan Mellor @ 2006-11-09 15:27 UTC (permalink / raw)
To: Stefan Berger; +Cc: Xen-devel
In-Reply-To: <1163014585.7906.2.camel@lt2.watson.ibm.com>
On Wed, Nov 08, 2006 at 02:36:25PM -0500, Stefan Berger wrote:
> The attached patch implements more of the Xen-API functionality related
> to the vTPM.
>
> Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
Applied, thank you.
Ewan.
^ permalink raw reply
* [PATCH/RFC] remove len/ooblen confusion in MTD/NAND code: respin
From: Vitaly Wool @ 2006-11-09 15:26 UTC (permalink / raw)
To: linux-mtd
Hello folks,
as was discussed between Ricard Wanderlof, David Woodhouse, Artem
Bityutskiy and me, the current API for reading/writing OOB is confusing.
The thing that introduces confusion is the need to specify ops.len
together with ops.ooblen for reads/writes that concern only OOB not data
area. So, ops.len is overloaded: when ops.datbuf != NULL it serves to
specify the length of the data read, and when ops.datbuf == NULL, it
serves to specify the full OOB read length.
The patch inlined differs from the previous one in two aspects:
- it's created against MTD git tree as opposed to the previous one which
was created against Linus's git tree
- it now handles OOB read length specified in combined reads (the
previous version just read oobavail bytes from the OOB on each data
read).
Thanks Artem/Thomas for review.
drivers/mtd/inftlcore.c | 6 +----
drivers/mtd/mtdchar.c | 12 ++++-------
drivers/mtd/mtdconcat.c | 39 +++++++++++++++++++++++---------------
drivers/mtd/mtdpart.c | 4 +--
drivers/mtd/nand/nand_base.c | 44 ++++++++++++++++++++++++++++---------------
drivers/mtd/nand/nand_bbt.c | 5 +---
drivers/mtd/nftlcore.c | 6 +----
drivers/mtd/ssfdc.c | 5 +---
fs/jffs2/wbuf.c | 21 ++++++++------------
include/linux/mtd/mtd.h | 12 ++++-------
10 files changed, 82 insertions(+), 72 deletions(-)
Signed-off-by: Vitaly Wool <vwool@ru.mvista.com>
Index: linux-2.6/drivers/mtd/inftlcore.c
===================================================================
--- linux-2.6.orig/drivers/mtd/inftlcore.c
+++ linux-2.6/drivers/mtd/inftlcore.c
@@ -163,10 +163,9 @@ int inftl_read_oob(struct mtd_info *mtd,
ops.ooblen = len;
ops.oobbuf = buf;
ops.datbuf = NULL;
- ops.len = len;
res = mtd->read_oob(mtd, offs & ~(mtd->writesize - 1), &ops);
- *retlen = ops.retlen;
+ *retlen = ops.oobretlen;
return res;
}
@@ -184,10 +183,9 @@ int inftl_write_oob(struct mtd_info *mtd
ops.ooblen = len;
ops.oobbuf = buf;
ops.datbuf = NULL;
- ops.len = len;
res = mtd->write_oob(mtd, offs & ~(mtd->writesize - 1), &ops);
- *retlen = ops.retlen;
+ *retlen = ops.oobretlen;
return res;
}
Index: linux-2.6/drivers/mtd/nand/nand_base.c
===================================================================
--- linux-2.6.orig/drivers/mtd/nand/nand_base.c
+++ linux-2.6/drivers/mtd/nand/nand_base.c
@@ -897,12 +897,11 @@ static int nand_read_page_syndrome(struc
* @chip: nand chip structure
* @oob: oob destination address
* @ops: oob ops structure
+ * @len: size of oob to transfer
*/
static uint8_t *nand_transfer_oob(struct nand_chip *chip, uint8_t *oob,
- struct mtd_oob_ops *ops)
+ struct mtd_oob_ops *ops, size_t len)
{
- size_t len = ops->ooblen;
-
switch(ops->mode) {
case MTD_OOB_PLACE:
@@ -1008,9 +1007,12 @@ static int nand_do_read_ops(struct mtd_i
if (unlikely(oob)) {
/* Raw mode does data:oob:data:oob */
if (ops->mode != MTD_OOB_RAW)
- oob = nand_transfer_oob(chip, oob, ops);
+ oob = nand_transfer_oob(chip,
+ oob, ops,
+ chip->ecc.layout->oobavail);
else
- buf = nand_transfer_oob(chip, buf, ops);
+ buf = nand_transfer_oob(chip,
+ buf, ops, mtd->oobsize);
}
if (!(chip->options & NAND_NO_READRDY)) {
@@ -1057,6 +1059,8 @@ static int nand_do_read_ops(struct mtd_i
}
ops->retlen = ops->len - (size_t) readlen;
+ if (oob)
+ ops->oobretlen = ops->ooblen;
if (ret)
return ret;
@@ -1257,12 +1261,18 @@ static int nand_do_read_oob(struct mtd_i
int page, realpage, chipnr, sndcmd = 1;
struct nand_chip *chip = mtd->priv;
int blkcheck = (1 << (chip->phys_erase_shift - chip->page_shift)) - 1;
- int readlen = ops->len;
+ int readlen = ops->ooblen;
+ int len;
uint8_t *buf = ops->oobbuf;
DEBUG(MTD_DEBUG_LEVEL3, "nand_read_oob: from = 0x%08Lx, len = %i\n",
(unsigned long long)from, readlen);
+ if (ops->mode == MTD_OOB_RAW)
+ len = mtd->oobsize;
+ else
+ len = chip->ecc.layout->oobavail;
+
chipnr = (int)(from >> chip->chip_shift);
chip->select_chip(mtd, chipnr);
@@ -1274,7 +1284,9 @@ static int nand_do_read_oob(struct mtd_i
while(1) {
sndcmd = chip->ecc.read_oob(mtd, chip, page, sndcmd);
- buf = nand_transfer_oob(chip, buf, ops);
+
+ len = min(len, readlen);
+ buf = nand_transfer_oob(chip, buf, ops, len);
if (!(chip->options & NAND_NO_READRDY)) {
/*
@@ -1289,7 +1301,7 @@ static int nand_do_read_oob(struct mtd_i
nand_wait_ready(mtd);
}
- readlen -= ops->ooblen;
+ readlen -= len;
if (!readlen)
break;
@@ -1311,7 +1323,7 @@ static int nand_do_read_oob(struct mtd_i
sndcmd = 1;
}
- ops->retlen = ops->len;
+ ops->oobretlen = ops->ooblen;
return 0;
}
@@ -1332,7 +1344,7 @@ static int nand_read_oob(struct mtd_info
ops->retlen = 0;
/* Do not allow reads past end of device */
- if ((from + ops->len) > mtd->size) {
+ if (ops->datbuf && (from + ops->len) > mtd->size) {
DEBUG(MTD_DEBUG_LEVEL0, "nand_read_oob: "
"Attempt read beyond end of device\n");
return -EINVAL;
@@ -1654,8 +1666,10 @@ static int nand_do_write_ops(struct mtd_
}
}
- if (unlikely(oob))
+ if (unlikely(oob)) {
memset(chip->oob_poi, 0xff, mtd->oobsize);
+ ops->oobretlen = ops->ooblen;
+ }
ops->retlen = ops->len - writelen;
return ret;
@@ -1713,10 +1727,10 @@ static int nand_do_write_oob(struct mtd_
struct nand_chip *chip = mtd->priv;
DEBUG(MTD_DEBUG_LEVEL3, "nand_write_oob: to = 0x%08x, len = %i\n",
- (unsigned int)to, (int)ops->len);
+ (unsigned int)to, (int)ops->ooblen);
/* Do not allow write past end of page */
- if ((ops->ooboffs + ops->len) > mtd->oobsize) {
+ if ((ops->ooboffs + ops->ooblen) > mtd->oobsize) {
DEBUG(MTD_DEBUG_LEVEL0, "nand_write_oob: "
"Attempt to write past end of page\n");
return -EINVAL;
@@ -1753,7 +1767,7 @@ static int nand_do_write_oob(struct mtd_
if (status)
return status;
- ops->retlen = ops->len;
+ ops->oobretlen = ops->ooblen;
return 0;
}
@@ -1773,7 +1787,7 @@ static int nand_write_oob(struct mtd_inf
ops->retlen = 0;
/* Do not allow writes past end of device */
- if ((to + ops->len) > mtd->size) {
+ if (ops->datbuf && (to + ops->len) > mtd->size) {
DEBUG(MTD_DEBUG_LEVEL0, "nand_read_oob: "
"Attempt read beyond end of device\n");
return -EINVAL;
Index: linux-2.6/drivers/mtd/mtdchar.c
===================================================================
--- linux-2.6.orig/drivers/mtd/mtdchar.c
+++ linux-2.6/drivers/mtd/mtdchar.c
@@ -499,13 +499,12 @@ static int mtd_ioctl(struct inode *inode
if (ret)
return ret;
- ops.len = buf.length;
ops.ooblen = buf.length;
ops.ooboffs = buf.start & (mtd->oobsize - 1);
ops.datbuf = NULL;
ops.mode = MTD_OOB_PLACE;
- if (ops.ooboffs && ops.len > (mtd->oobsize - ops.ooboffs))
+ if (ops.ooboffs && ops.ooblen > (mtd->oobsize - ops.ooboffs))
return -EINVAL;
ops.oobbuf = kmalloc(buf.length, GFP_KERNEL);
@@ -520,7 +519,7 @@ static int mtd_ioctl(struct inode *inode
buf.start &= ~(mtd->oobsize - 1);
ret = mtd->write_oob(mtd, buf.start, &ops);
- if (copy_to_user(argp + sizeof(uint32_t), &ops.retlen,
+ if (copy_to_user(argp + sizeof(uint32_t), &ops.oobretlen,
sizeof(uint32_t)))
ret = -EFAULT;
@@ -548,7 +547,6 @@ static int mtd_ioctl(struct inode *inode
if (ret)
return ret;
- ops.len = buf.length;
ops.ooblen = buf.length;
ops.ooboffs = buf.start & (mtd->oobsize - 1);
ops.datbuf = NULL;
@@ -564,10 +562,10 @@ static int mtd_ioctl(struct inode *inode
buf.start &= ~(mtd->oobsize - 1);
ret = mtd->read_oob(mtd, buf.start, &ops);
- if (put_user(ops.retlen, (uint32_t __user *)argp))
+ if (put_user(ops.oobretlen, (uint32_t __user *)argp))
ret = -EFAULT;
- else if (ops.retlen && copy_to_user(buf.ptr, ops.oobbuf,
- ops.retlen))
+ else if (ops.oobretlen && copy_to_user(buf.ptr, ops.oobbuf,
+ ops.oobretlen))
ret = -EFAULT;
kfree(ops.oobbuf);
Index: linux-2.6/drivers/mtd/mtdconcat.c
===================================================================
--- linux-2.6.orig/drivers/mtd/mtdconcat.c
+++ linux-2.6/drivers/mtd/mtdconcat.c
@@ -247,7 +247,7 @@ concat_read_oob(struct mtd_info *mtd, lo
struct mtd_oob_ops devops = *ops;
int i, err, ret = 0;
- ops->retlen = 0;
+ ops->retlen = ops->oobretlen = 0;
for (i = 0; i < concat->num_subdev; i++) {
struct mtd_info *subdev = concat->subdev[i];
@@ -263,6 +263,7 @@ concat_read_oob(struct mtd_info *mtd, lo
err = subdev->read_oob(subdev, from, &devops);
ops->retlen += devops.retlen;
+ ops->oobretlen += devops.oobretlen;
/* Save information about bitflips! */
if (unlikely(err)) {
@@ -278,14 +279,18 @@ concat_read_oob(struct mtd_info *mtd, lo
return err;
}
- devops.len = ops->len - ops->retlen;
- if (!devops.len)
- return ret;
-
- if (devops.datbuf)
+ if (devops.datbuf) {
+ devops.len = ops->len - ops->retlen;
+ if (!devops.len)
+ return ret;
devops.datbuf += devops.retlen;
- if (devops.oobbuf)
- devops.oobbuf += devops.ooblen;
+ }
+ if (devops.oobbuf) {
+ devops.ooblen = ops->ooblen - ops->oobretlen;
+ if (!devops.ooblen)
+ return ret;
+ devops.oobbuf += ops->oobretlen;
+ }
from = 0;
}
@@ -321,14 +326,18 @@ concat_write_oob(struct mtd_info *mtd, l
if (err)
return err;
- devops.len = ops->len - ops->retlen;
- if (!devops.len)
- return 0;
-
- if (devops.datbuf)
+ if (devops.datbuf) {
+ devops.len = ops->len - ops->retlen;
+ if (!devops.len)
+ return 0;
devops.datbuf += devops.retlen;
- if (devops.oobbuf)
- devops.oobbuf += devops.ooblen;
+ }
+ if (devops.oobbuf) {
+ devops.ooblen = ops->ooblen - ops->oobretlen;
+ if (!devops.ooblen)
+ return 0;
+ devops.oobbuf += devops.oobretlen;
+ }
to = 0;
}
return -EINVAL;
Index: linux-2.6/drivers/mtd/nand/nand_bbt.c
===================================================================
--- linux-2.6.orig/drivers/mtd/nand/nand_bbt.c
+++ linux-2.6/drivers/mtd/nand/nand_bbt.c
@@ -333,7 +333,6 @@ static int scan_block_fast(struct mtd_in
struct mtd_oob_ops ops;
int j, ret;
- ops.len = mtd->oobsize;
ops.ooblen = mtd->oobsize;
ops.oobbuf = buf;
ops.ooboffs = 0;
@@ -676,10 +675,10 @@ static int write_bbt(struct mtd_info *mt
"bad block table\n");
}
/* Read oob data */
- ops.len = (len >> this->page_shift) * mtd->oobsize;
+ ops.ooblen = (len >> this->page_shift) * mtd->oobsize;
ops.oobbuf = &buf[len];
res = mtd->read_oob(mtd, to + mtd->writesize, &ops);
- if (res < 0 || ops.retlen != ops.len)
+ if (res < 0 || ops.oobretlen != ops.ooblen)
goto outerr;
/* Calc the byte offset in the buffer */
Index: linux-2.6/drivers/mtd/nftlcore.c
===================================================================
--- linux-2.6.orig/drivers/mtd/nftlcore.c
+++ linux-2.6/drivers/mtd/nftlcore.c
@@ -147,10 +147,9 @@ int nftl_read_oob(struct mtd_info *mtd,
ops.ooblen = len;
ops.oobbuf = buf;
ops.datbuf = NULL;
- ops.len = len;
res = mtd->read_oob(mtd, offs & ~(mtd->writesize - 1), &ops);
- *retlen = ops.retlen;
+ *retlen = ops.oobretlen;
return res;
}
@@ -168,10 +167,9 @@ int nftl_write_oob(struct mtd_info *mtd,
ops.ooblen = len;
ops.oobbuf = buf;
ops.datbuf = NULL;
- ops.len = len;
res = mtd->write_oob(mtd, offs & ~(mtd->writesize - 1), &ops);
- *retlen = ops.retlen;
+ *retlen = ops.oobretlen;
return res;
}
Index: linux-2.6/drivers/mtd/ssfdc.c
===================================================================
--- linux-2.6.orig/drivers/mtd/ssfdc.c
+++ linux-2.6/drivers/mtd/ssfdc.c
@@ -172,13 +172,12 @@ static int read_raw_oob(struct mtd_info
ops.mode = MTD_OOB_RAW;
ops.ooboffs = 0;
- ops.ooblen = mtd->oobsize;
- ops.len = OOB_SIZE;
+ ops.ooblen = OOB_SIZE;
ops.oobbuf = buf;
ops.datbuf = NULL;
ret = mtd->read_oob(mtd, offs, &ops);
- if (ret < 0 || ops.retlen != OOB_SIZE)
+ if (ret < 0 || ops.oobretlen != OOB_SIZE)
return -1;
return 0;
Index: linux-2.6/fs/jffs2/wbuf.c
===================================================================
--- linux-2.6.orig/fs/jffs2/wbuf.c
+++ linux-2.6/fs/jffs2/wbuf.c
@@ -968,8 +968,7 @@ int jffs2_check_oob_empty(struct jffs2_s
int oobsize = c->mtd->oobsize;
struct mtd_oob_ops ops;
- ops.len = NR_OOB_SCAN_PAGES * oobsize;
- ops.ooblen = oobsize;
+ ops.ooblen = NR_OOB_SCAN_PAGES * oobsize;
ops.oobbuf = c->oobbuf;
ops.ooboffs = 0;
ops.datbuf = NULL;
@@ -982,10 +981,10 @@ int jffs2_check_oob_empty(struct jffs2_s
return ret;
}
- if (ops.retlen < ops.len) {
+ if (ops.oobretlen < ops.ooblen) {
D1(printk(KERN_WARNING "jffs2_check_oob_empty(): Read OOB "
"returned short read (%zd bytes not %d) for block "
- "at %08x\n", ops.retlen, ops.len, jeb->offset));
+ "at %08x\n", ops.oobretlen, ops.ooblen, jeb->offset));
return -EIO;
}
@@ -1004,7 +1003,7 @@ int jffs2_check_oob_empty(struct jffs2_s
}
/* we know, we are aligned :) */
- for (page = oobsize; page < ops.len; page += sizeof(long)) {
+ for (page = oobsize; page < ops.ooblen; page += sizeof(long)) {
long dat = *(long *)(&ops.oobbuf[page]);
if(dat != -1)
return 1;
@@ -1032,7 +1031,6 @@ int jffs2_check_nand_cleanmarker (struct
return 2;
}
- ops.len = oobsize;
ops.ooblen = oobsize;
ops.oobbuf = c->oobbuf;
ops.ooboffs = 0;
@@ -1047,10 +1045,10 @@ int jffs2_check_nand_cleanmarker (struct
return ret;
}
- if (ops.retlen < ops.len) {
+ if (ops.oobretlen < ops.ooblen) {
D1 (printk (KERN_WARNING "jffs2_check_nand_cleanmarker(): "
"Read OOB return short read (%zd bytes not %d) "
- "for block at %08x\n", ops.retlen, ops.len,
+ "for block at %08x\n", ops.oobretlen, ops.ooblen,
jeb->offset));
return -EIO;
}
@@ -1089,8 +1087,7 @@ int jffs2_write_nand_cleanmarker(struct
n.nodetype = cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER);
n.totlen = cpu_to_je32(8);
- ops.len = c->fsdata_len;
- ops.ooblen = c->fsdata_len;;
+ ops.ooblen = c->fsdata_len;
ops.oobbuf = (uint8_t *)&n;
ops.ooboffs = c->fsdata_pos;
ops.datbuf = NULL;
@@ -1104,10 +1101,10 @@ int jffs2_write_nand_cleanmarker(struct
jeb->offset, ret));
return ret;
}
- if (ops.retlen != ops.len) {
+ if (ops.oobretlen != ops.ooblen) {
D1(printk(KERN_WARNING "jffs2_write_nand_cleanmarker(): "
"Short write for block at %08x: %zd not %d\n",
- jeb->offset, ops.retlen, ops.len));
+ jeb->offset, ops.oobretlen, ops.ooblen));
return -EIO;
}
return 0;
Index: linux-2.6/drivers/mtd/mtdpart.c
===================================================================
--- linux-2.6.orig/drivers/mtd/mtdpart.c
+++ linux-2.6/drivers/mtd/mtdpart.c
@@ -94,7 +94,7 @@ static int part_read_oob(struct mtd_info
if (from >= mtd->size)
return -EINVAL;
- if (from + ops->len > mtd->size)
+ if (ops->datbuf && from + ops->len > mtd->size)
return -EINVAL;
res = part->master->read_oob(part->master, from + part->offset, ops);
@@ -161,7 +161,7 @@ static int part_write_oob(struct mtd_inf
if (to >= mtd->size)
return -EINVAL;
- if (to + ops->len > mtd->size)
+ if (ops->datbuf && to + ops->len > mtd->size)
return -EINVAL;
return part->master->write_oob(part->master, to + part->offset, ops);
}
Index: linux-2.6/include/linux/mtd/mtd.h
===================================================================
--- linux-2.6.orig/include/linux/mtd/mtd.h
+++ linux-2.6/include/linux/mtd/mtd.h
@@ -75,15 +75,12 @@ typedef enum {
* struct mtd_oob_ops - oob operation operands
* @mode: operation mode
*
- * @len: number of bytes to write/read. When a data buffer is given
- * (datbuf != NULL) this is the number of data bytes. When
- * no data buffer is available this is the number of oob bytes.
+ * @len: number of data bytes to write/read
*
- * @retlen: number of bytes written/read. When a data buffer is given
- * (datbuf != NULL) this is the number of data bytes. When
- * no data buffer is available this is the number of oob bytes.
+ * @retlen: number of data bytes written/read
*
- * @ooblen: number of oob bytes per page
+ * @ooblen: number of oob bytes to write/read
+ * @oobretlen: number of oob bytes written/read
* @ooboffs: offset of oob data in the oob area (only relevant when
* mode = MTD_OOB_PLACE)
* @datbuf: data buffer - if NULL only oob data are read/written
@@ -94,6 +91,7 @@ struct mtd_oob_ops {
size_t len;
size_t retlen;
size_t ooblen;
+ size_t oobretlen;
uint32_t ooboffs;
uint8_t *datbuf;
uint8_t *oobbuf;
^ permalink raw reply
* [PATCH 3/3] new_inode_autonum: fix up possible i_ino collision in simple_fill_super()
From: Jeff Layton @ 2006-11-09 15:24 UTC (permalink / raw)
To: linux-fsdevel, linux-kernel, akpm
simple_fill_super() looked like a bug waiting to happen. It is fairly hard to
trigger, but still. This should fix it, although in a fairly crude manner.
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
diff --git a/fs/libfs.c b/fs/libfs.c
index bd08e0e..477c012 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -373,6 +373,10 @@ int simple_fill_super(struct super_block
inode = new_inode(s);
if (!inode)
return -ENOMEM;
+ /* ino must not collide with any ino assigned in the loop below.
+ * This value is arbitrary but should be "big enough" to avoid
+ * collisions. */
+ inode->i_ino = 0x8000000;
inode->i_mode = S_IFDIR | 0755;
inode->i_uid = inode->i_gid = 0;
inode->i_blocks = 0;
^ permalink raw reply related
* [PATCH 2/3] new_inode_autonum: convert filesystems to use new function
From: Jeff Layton @ 2006-11-09 15:24 UTC (permalink / raw)
To: linux-fsdevel, linux-kernel, akpm
This patch converts all in-tree filesystems that blindly use the i_ino
value given by new_inode to use new_inode_autonum. Also fix up a few
other cases where i_ino might not end up being unique.
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 3aaede0..da76197 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -2170,7 +2170,7 @@ pfm_alloc_fd(struct file **cfile)
/*
* allocate a new inode
*/
- inode = new_inode(pfmfs_mnt->mnt_sb);
+ inode = new_inode_autonum(pfmfs_mnt->mnt_sb);
if (!inode) goto out;
DPRINT(("new inode ino=%ld @%p\n", inode->i_ino, inode));
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 427d00a..5d6aaa8 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -79,7 +79,7 @@ spufs_new_inode(struct super_block *sb,
{
struct inode *inode;
- inode = new_inode(sb);
+ inode = new_inode_autonum(sb);
if (!inode)
goto out;
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c
index cd702ae..7d59814 100644
--- a/arch/s390/hypfs/inode.c
+++ b/arch/s390/hypfs/inode.c
@@ -84,7 +84,7 @@ static void hypfs_delete_tree(struct den
static struct inode *hypfs_make_inode(struct super_block *sb, int mode)
{
- struct inode *ret = new_inode(sb);
+ struct inode *ret = new_inode_autonum(sb);
if (ret) {
struct hypfs_sb_info *hypfs_info = sb->s_fs_info;
diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c
index d9ff283..02e3559 100644
--- a/drivers/infiniband/hw/ipath/ipath_fs.c
+++ b/drivers/infiniband/hw/ipath/ipath_fs.c
@@ -51,7 +51,7 @@ static int ipathfs_mknod(struct inode *d
void *data)
{
int error;
- struct inode *inode = new_inode(dir->i_sb);
+ struct inode *inode = new_inode_autonum(dir->i_sb);
if (!inode) {
error = -EPERM;
diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c
index b99dc50..2921dc1 100644
--- a/drivers/misc/ibmasm/ibmasmfs.c
+++ b/drivers/misc/ibmasm/ibmasmfs.c
@@ -142,7 +142,7 @@ static int ibmasmfs_fill_super (struct s
static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode)
{
- struct inode *ret = new_inode(sb);
+ struct inode *ret = new_inode_autonum(sb);
if (ret) {
ret->i_mode = mode;
diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c
index 5756401..962e809 100644
--- a/drivers/oprofile/oprofilefs.c
+++ b/drivers/oprofile/oprofilefs.c
@@ -25,7 +25,7 @@ DEFINE_SPINLOCK(oprofilefs_lock);
static struct inode * oprofilefs_get_inode(struct super_block * sb, int mode)
{
- struct inode * inode = new_inode(sb);
+ struct inode * inode = new_inode_autonum(sb);
if (inode) {
inode->i_mode = mode;
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c
index b5d6a79..673d91c 100644
--- a/drivers/usb/core/inode.c
+++ b/drivers/usb/core/inode.c
@@ -243,7 +243,7 @@ static int remount(struct super_block *s
static struct inode *usbfs_get_inode (struct super_block *sb, int mode, dev_t dev)
{
- struct inode *inode = new_inode(sb);
+ struct inode *inode = new_inode_autonum(sb);
if (inode) {
inode->i_mode = mode;
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index 86924f9..63ba800 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -2026,7 +2026,7 @@ gadgetfs_make_inode (struct super_block
void *data, const struct file_operations *fops,
int mode)
{
- struct inode *inode = new_inode (sb);
+ struct inode *inode = new_inode_autonum(sb);
if (inode) {
inode->i_mode = mode;
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 5241c60..71b91de 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -199,7 +199,7 @@ struct inode *v9fs_get_inode(struct supe
dprintk(DEBUG_VFS, "super block: %p mode: %o\n", sb, mode);
- inode = new_inode(sb);
+ inode = new_inode_autonum(sb);
if (inode) {
inode->i_mode = mode;
inode->i_uid = current->fsuid;
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c
index 51fd859..bc18888 100644
--- a/fs/autofs4/inode.c
+++ b/fs/autofs4/inode.c
@@ -419,7 +419,7 @@ fail_unlock:
struct inode *autofs4_get_inode(struct super_block *sb,
struct autofs_info *inf)
{
- struct inode *inode = new_inode(sb);
+ struct inode *inode = new_inode_autonum(sb);
if (inode == NULL)
return NULL;
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index 1713c48..8fe64a8 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -499,7 +499,7 @@ static void entry_status(Node *e, char *
static struct inode *bm_get_inode(struct super_block *sb, int mode)
{
- struct inode * inode = new_inode(sb);
+ struct inode * inode = new_inode_autonum(sb);
if (inode) {
inode->i_mode = mode;
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index dffe295..5d566e0 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -80,7 +80,7 @@ int cifs_get_inode_info_unix(struct inod
/* get new inode */
if (*pinode == NULL) {
- *pinode = new_inode(sb);
+ *pinode = new_inode_autonum(sb);
if (*pinode == NULL)
return -ENOMEM;
/* Is an i_ino of zero legal? */
@@ -89,7 +89,9 @@ int cifs_get_inode_info_unix(struct inod
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
(*pinode)->i_ino =
(unsigned long)findData.UniqueId;
- } /* note ino incremented to unique num in new_inode */
+ } else {
+ (*pinode)->i_ino = iunique(sb, 0);
+ }
insert_inode_hash(*pinode);
}
@@ -418,7 +420,7 @@ int cifs_get_inode_info(struct inode **p
/* BB EOPNOSUPP disable SERVER_INUM? */
} else /* do we need cast or hash to ino? */
(*pinode)->i_ino = inode_num;
- } /* else ino incremented to unique num in new_inode*/
+ } /* else ino incremented to unique num in new_inode_autonum*/
insert_inode_hash(*pinode);
}
inode = *pinode;
diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c
index fb18917..b0fad8c 100644
--- a/fs/configfs/inode.c
+++ b/fs/configfs/inode.c
@@ -133,7 +133,7 @@ static inline void set_inode_attr(struct
struct inode * configfs_new_inode(mode_t mode, struct configfs_dirent * sd)
{
- struct inode * inode = new_inode(configfs_sb);
+ struct inode * inode = new_inode_autonum(configfs_sb);
if (inode) {
inode->i_blocks = 0;
inode->i_mapping->a_ops = &configfs_aops;
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index e77676d..331aad9 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -34,7 +34,7 @@ static int debugfs_mount_count;
static struct inode *debugfs_get_inode(struct super_block *sb, int mode, dev_t dev)
{
- struct inode *inode = new_inode(sb);
+ struct inode *inode = new_inode_autonum(sb);
if (inode) {
inode->i_mode = mode;
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index ae228ec..bd64487 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1623,7 +1623,7 @@ static int eventpollfs_delete_dentry(str
static struct inode *ep_eventpoll_inode(void)
{
int error = -ENOMEM;
- struct inode *inode = new_inode(eventpoll_mnt->mnt_sb);
+ struct inode *inode = new_inode_autonum(eventpoll_mnt->mnt_sb);
if (!inode)
goto eexit_1;
diff --git a/fs/freevxfs/vxfs_inode.c b/fs/freevxfs/vxfs_inode.c
index 4786d51..c92df28 100644
--- a/fs/freevxfs/vxfs_inode.c
+++ b/fs/freevxfs/vxfs_inode.c
@@ -261,7 +261,7 @@ vxfs_get_fake_inode(struct super_block *
{
struct inode *ip = NULL;
- if ((ip = new_inode(sbp))) {
+ if ((ip = new_inode_autonum(sbp))) {
vxfs_iinit(ip, vip);
ip->i_mapping->a_ops = &vxfs_aops;
}
diff --git a/fs/fuse/control.c b/fs/fuse/control.c
index 16b39c0..a5caf5a 100644
--- a/fs/fuse/control.c
+++ b/fs/fuse/control.c
@@ -85,7 +85,7 @@ static struct dentry *fuse_ctl_add_dentr
return NULL;
fc->ctl_dentry[fc->ctl_ndents++] = dentry;
- inode = new_inode(fuse_control_sb);
+ inode = new_inode_autonum(fuse_control_sb);
if (!inode)
return NULL;
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 0bea6a6..213c6c0 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -349,7 +349,7 @@ static struct inode *hugetlbfs_get_inode
{
struct inode *inode;
- inode = new_inode(sb);
+ inode = new_inode_autonum(sb);
if (inode) {
struct hugetlbfs_inode_info *info;
inode->i_mode = mode;
diff --git a/fs/jfs/jfs_inode.c b/fs/jfs/jfs_inode.c
index 4c67ed9..cc9a7bc 100644
--- a/fs/jfs/jfs_inode.c
+++ b/fs/jfs/jfs_inode.c
@@ -58,7 +58,7 @@ struct inode *ialloc(struct inode *paren
struct jfs_inode_info *jfs_inode;
int rc;
- inode = new_inode(sb);
+ inode = new_inode_autonum(sb);
if (!inode) {
jfs_warn("ialloc: new_inode returned NULL!");
return ERR_PTR(-ENOMEM);
diff --git a/fs/ocfs2/dlm/dlmfs.c b/fs/ocfs2/dlm/dlmfs.c
index 16b8d1b..f38c914 100644
--- a/fs/ocfs2/dlm/dlmfs.c
+++ b/fs/ocfs2/dlm/dlmfs.c
@@ -325,7 +325,7 @@ static struct backing_dev_info dlmfs_bac
static struct inode *dlmfs_get_root_inode(struct super_block *sb)
{
- struct inode *inode = new_inode(sb);
+ struct inode *inode = new_inode_autonum(sb);
int mode = S_IFDIR | 0755;
struct dlmfs_inode_private *ip;
@@ -352,7 +352,7 @@ static struct inode *dlmfs_get_inode(str
int mode)
{
struct super_block *sb = parent->i_sb;
- struct inode * inode = new_inode(sb);
+ struct inode * inode = new_inode_autonum(sb);
struct dlmfs_inode_private *ip;
if (!inode)
diff --git a/fs/pipe.c b/fs/pipe.c
index b1626f2..fb14bd1 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -839,7 +839,7 @@ static struct dentry_operations pipefs_d
static struct inode * get_pipe_inode(void)
{
- struct inode *inode = new_inode(pipe_mnt->mnt_sb);
+ struct inode *inode = new_inode_autonum(pipe_mnt->mnt_sb);
struct pipe_inode_info *pipe;
if (!inode)
diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c
index 2faf4cd..03573d4 100644
--- a/fs/ramfs/inode.c
+++ b/fs/ramfs/inode.c
@@ -52,7 +52,7 @@ static struct backing_dev_info ramfs_bac
struct inode *ramfs_get_inode(struct super_block *sb, int mode, dev_t dev)
{
- struct inode * inode = new_inode(sb);
+ struct inode * inode = new_inode_autonum(sb);
if (inode) {
inode->i_mode = mode;
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index e79e38d..6dc0e0f 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -123,7 +123,7 @@ static struct lock_class_key sysfs_inode
struct inode * sysfs_new_inode(mode_t mode, struct sysfs_dirent * sd)
{
- struct inode * inode = new_inode(sysfs_sb);
+ struct inode * inode = new_inode_autonum(sysfs_sb);
if (inode) {
inode->i_blocks = 0;
inode->i_mapping->a_ops = &sysfs_aops;
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 7c27400..a8c83e5 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -110,7 +110,7 @@ static struct inode *mqueue_get_inode(st
{
struct inode *inode;
- inode = new_inode(sb);
+ inode = new_inode_autonum(sb);
if (inode) {
inode->i_mode = mode;
inode->i_uid = current->fsuid;
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 6313c38..6dd0156 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -283,7 +283,7 @@ static struct backing_dev_info cpuset_ba
static struct inode *cpuset_new_inode(mode_t mode)
{
- struct inode *inode = new_inode(cpuset_sb);
+ struct inode *inode = new_inode_autonum(cpuset_sb);
if (inode) {
inode->i_mode = mode;
diff --git a/mm/shmem.c b/mm/shmem.c
index 4959535..0d47801 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1354,7 +1354,7 @@ shmem_get_inode(struct super_block *sb,
spin_unlock(&sbinfo->stat_lock);
}
- inode = new_inode(sb);
+ inode = new_inode_autonum(sb);
if (inode) {
inode->i_mode = mode;
inode->i_uid = current->fsuid;
diff --git a/net/socket.c b/net/socket.c
index 6c9b9b3..e8d75f5 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -474,7 +474,7 @@ static struct socket *sock_alloc(void)
struct inode *inode;
struct socket *sock;
- inode = new_inode(sock_mnt->mnt_sb);
+ inode = new_inode_autonum(sock_mnt->mnt_sb);
if (!inode)
return NULL;
diff --git a/security/inode.c b/security/inode.c
index 9b16e14..b1a4e08 100644
--- a/security/inode.c
+++ b/security/inode.c
@@ -58,7 +58,7 @@ static struct file_operations default_fi
static struct inode *get_inode(struct super_block *sb, int mode, dev_t dev)
{
- struct inode *inode = new_inode(sb);
+ struct inode *inode = new_inode_autonum(sb);
if (inode) {
inode->i_mode = mode;
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index cd24441..98493ce 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -766,7 +766,7 @@ out:
static struct inode *sel_make_inode(struct super_block *sb, int mode)
{
- struct inode *ret = new_inode(sb);
+ struct inode *ret = new_inode_autonum(sb);
if (ret) {
ret->i_mode = mode;
^ permalink raw reply related
* [PATCH 1/3] new_inode_autonum: add per-sb lastino counter and add new_inode_autonum function that guarantees i_ino uniqueness
From: Jeff Layton @ 2006-11-09 15:24 UTC (permalink / raw)
To: linux-fsdevel, linux-kernel, akpm
- add a new per superblock s_nextino counter and change iunique to use it
instead of its global inode counter
- make the size of the counter conditional on CONFIG_COMPAT. This is to try
prevent userspace EOVERFLOWs when 32-bit programs not compiled with large
offsets are run on 64-bit kernels
- add new_inode_autonum which guarantees that i_ino is assigned a unique val
on the filesystem.
- Change new_inode to assign i_ino to 0 to catch filesystems that use it and
don't reset it to a unique value.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Acked-by: Joern Engel <joern@wh.fh-wedel.de>
diff --git a/fs/inode.c b/fs/inode.c
index 26cdb11..cbe466f 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -517,14 +517,14 @@ repeat:
}
/**
- * new_inode - obtain an inode
+ * __new_inode - obtain an inode
* @sb: superblock
+ * @autonum: if true, make sure that i_ino is unique
*
* Allocates a new inode for given superblock.
*/
-struct inode *new_inode(struct super_block *sb)
+static struct inode *__new_inode(struct super_block *sb)
{
- static unsigned long last_ino;
struct inode * inode;
spin_lock_prefetch(&inode_lock);
@@ -535,13 +535,46 @@ struct inode *new_inode(struct super_blo
inodes_stat.nr_inodes++;
list_add(&inode->i_list, &inode_in_use);
list_add(&inode->i_sb_list, &sb->s_inodes);
- inode->i_ino = ++last_ino;
inode->i_state = 0;
spin_unlock(&inode_lock);
}
return inode;
}
+/**
+ * new_inode_autonum - obtain an inode with a unique i_ino value
+ * @sb: superblock
+ *
+ * Allocates a new inode for given superblock. Ensures that i_ino is
+ * unique on the filesystem.
+ */
+struct inode *new_inode_autonum(struct super_block *sb)
+{
+ struct inode *inode;
+
+ inode = __new_inode(sb);
+ inode->i_ino = iunique(sb, 0);
+ return inode;
+}
+
+EXPORT_SYMBOL(new_inode_autonum);
+
+/**
+ * new_inode - obtain an inode -- i_ino not guaranteed unique
+ * @sb: superblock
+ *
+ * Allocates a new inode for given superblock. i_ino is not guaranteed to
+ * be unique. Should only be used when i_ino is going to be clobbered.
+ */
+struct inode *new_inode(struct super_block *sb)
+{
+ struct inode *inode;
+
+ inode = __new_inode(sb);
+ inode->i_ino = 0; /* 0 to try to catch callers that don't reset it */
+ return inode;
+}
+
EXPORT_SYMBOL(new_inode);
void unlock_new_inode(struct inode *inode)
@@ -683,22 +716,21 @@ static unsigned long hash(struct super_b
*/
ino_t iunique(struct super_block *sb, ino_t max_reserved)
{
- static ino_t counter;
struct inode *inode;
struct hlist_head * head;
ino_t res;
spin_lock(&inode_lock);
retry:
- if (counter > max_reserved) {
- head = inode_hashtable + hash(sb,counter);
- res = counter++;
+ if (sb->s_nextino > max_reserved) {
+ head = inode_hashtable + hash(sb,sb->s_nextino);
+ res = sb->s_nextino++;
inode = find_inode_fast(sb, head, res);
if (!inode) {
spin_unlock(&inode_lock);
return res;
}
} else {
- counter = max_reserved + 1;
+ sb->s_nextino = max_reserved + 1;
}
goto retry;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 2fe6e3f..3dd0e0f 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -961,6 +961,14 @@ #endif
/* Granularity of c/m/atime in ns.
Cannot be worse than a second */
u32 s_time_gran;
+
+ /* per-sb inode counter for new_inode. Make it a 32-bit counter when
+ we have the possibility of dealing with 32-bit apps */
+#ifdef CONFIG_COMPAT
+ unsigned int s_nextino;
+#else
+ unsigned long s_nextino;
+#endif
};
extern struct timespec current_fs_time(struct super_block *sb);
@@ -1712,6 +1720,7 @@ extern void __iget(struct inode * inode)
extern void clear_inode(struct inode *);
extern void destroy_inode(struct inode *);
extern struct inode *new_inode(struct super_block *);
+extern struct inode *new_inode_autonum(struct super_block *);
extern int __remove_suid(struct dentry *, int);
extern int should_remove_suid(struct dentry *);
extern int remove_suid(struct dentry *);
^ permalink raw reply related
* [PATCH 3/3] new_inode_autonum: fix up possible i_ino collision in simple_fill_super()
From: Jeff Layton @ 2006-11-09 15:24 UTC (permalink / raw)
To: linux-fsdevel, linux-kernel, akpm
simple_fill_super() looked like a bug waiting to happen. It is fairly hard to
trigger, but still. This should fix it, although in a fairly crude manner.
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
diff --git a/fs/libfs.c b/fs/libfs.c
index bd08e0e..477c012 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -373,6 +373,10 @@ int simple_fill_super(struct super_block
inode = new_inode(s);
if (!inode)
return -ENOMEM;
+ /* ino must not collide with any ino assigned in the loop below.
+ * This value is arbitrary but should be "big enough" to avoid
+ * collisions. */
+ inode->i_ino = 0x8000000;
inode->i_mode = S_IFDIR | 0755;
inode->i_uid = inode->i_gid = 0;
inode->i_blocks = 0;
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH 2/3] new_inode_autonum: convert filesystems to use new function
From: Jeff Layton @ 2006-11-09 15:24 UTC (permalink / raw)
To: linux-fsdevel, linux-kernel, akpm
This patch converts all in-tree filesystems that blindly use the i_ino
value given by new_inode to use new_inode_autonum. Also fix up a few
other cases where i_ino might not end up being unique.
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 3aaede0..da76197 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -2170,7 +2170,7 @@ pfm_alloc_fd(struct file **cfile)
/*
* allocate a new inode
*/
- inode = new_inode(pfmfs_mnt->mnt_sb);
+ inode = new_inode_autonum(pfmfs_mnt->mnt_sb);
if (!inode) goto out;
DPRINT(("new inode ino=%ld @%p\n", inode->i_ino, inode));
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 427d00a..5d6aaa8 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -79,7 +79,7 @@ spufs_new_inode(struct super_block *sb,
{
struct inode *inode;
- inode = new_inode(sb);
+ inode = new_inode_autonum(sb);
if (!inode)
goto out;
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c
index cd702ae..7d59814 100644
--- a/arch/s390/hypfs/inode.c
+++ b/arch/s390/hypfs/inode.c
@@ -84,7 +84,7 @@ static void hypfs_delete_tree(struct den
static struct inode *hypfs_make_inode(struct super_block *sb, int mode)
{
- struct inode *ret = new_inode(sb);
+ struct inode *ret = new_inode_autonum(sb);
if (ret) {
struct hypfs_sb_info *hypfs_info = sb->s_fs_info;
diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c
index d9ff283..02e3559 100644
--- a/drivers/infiniband/hw/ipath/ipath_fs.c
+++ b/drivers/infiniband/hw/ipath/ipath_fs.c
@@ -51,7 +51,7 @@ static int ipathfs_mknod(struct inode *d
void *data)
{
int error;
- struct inode *inode = new_inode(dir->i_sb);
+ struct inode *inode = new_inode_autonum(dir->i_sb);
if (!inode) {
error = -EPERM;
diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c
index b99dc50..2921dc1 100644
--- a/drivers/misc/ibmasm/ibmasmfs.c
+++ b/drivers/misc/ibmasm/ibmasmfs.c
@@ -142,7 +142,7 @@ static int ibmasmfs_fill_super (struct s
static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode)
{
- struct inode *ret = new_inode(sb);
+ struct inode *ret = new_inode_autonum(sb);
if (ret) {
ret->i_mode = mode;
diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c
index 5756401..962e809 100644
--- a/drivers/oprofile/oprofilefs.c
+++ b/drivers/oprofile/oprofilefs.c
@@ -25,7 +25,7 @@ DEFINE_SPINLOCK(oprofilefs_lock);
static struct inode * oprofilefs_get_inode(struct super_block * sb, int mode)
{
- struct inode * inode = new_inode(sb);
+ struct inode * inode = new_inode_autonum(sb);
if (inode) {
inode->i_mode = mode;
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c
index b5d6a79..673d91c 100644
--- a/drivers/usb/core/inode.c
+++ b/drivers/usb/core/inode.c
@@ -243,7 +243,7 @@ static int remount(struct super_block *s
static struct inode *usbfs_get_inode (struct super_block *sb, int mode, dev_t dev)
{
- struct inode *inode = new_inode(sb);
+ struct inode *inode = new_inode_autonum(sb);
if (inode) {
inode->i_mode = mode;
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index 86924f9..63ba800 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -2026,7 +2026,7 @@ gadgetfs_make_inode (struct super_block
void *data, const struct file_operations *fops,
int mode)
{
- struct inode *inode = new_inode (sb);
+ struct inode *inode = new_inode_autonum(sb);
if (inode) {
inode->i_mode = mode;
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 5241c60..71b91de 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -199,7 +199,7 @@ struct inode *v9fs_get_inode(struct supe
dprintk(DEBUG_VFS, "super block: %p mode: %o\n", sb, mode);
- inode = new_inode(sb);
+ inode = new_inode_autonum(sb);
if (inode) {
inode->i_mode = mode;
inode->i_uid = current->fsuid;
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c
index 51fd859..bc18888 100644
--- a/fs/autofs4/inode.c
+++ b/fs/autofs4/inode.c
@@ -419,7 +419,7 @@ fail_unlock:
struct inode *autofs4_get_inode(struct super_block *sb,
struct autofs_info *inf)
{
- struct inode *inode = new_inode(sb);
+ struct inode *inode = new_inode_autonum(sb);
if (inode == NULL)
return NULL;
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index 1713c48..8fe64a8 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -499,7 +499,7 @@ static void entry_status(Node *e, char *
static struct inode *bm_get_inode(struct super_block *sb, int mode)
{
- struct inode * inode = new_inode(sb);
+ struct inode * inode = new_inode_autonum(sb);
if (inode) {
inode->i_mode = mode;
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index dffe295..5d566e0 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -80,7 +80,7 @@ int cifs_get_inode_info_unix(struct inod
/* get new inode */
if (*pinode == NULL) {
- *pinode = new_inode(sb);
+ *pinode = new_inode_autonum(sb);
if (*pinode == NULL)
return -ENOMEM;
/* Is an i_ino of zero legal? */
@@ -89,7 +89,9 @@ int cifs_get_inode_info_unix(struct inod
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
(*pinode)->i_ino =
(unsigned long)findData.UniqueId;
- } /* note ino incremented to unique num in new_inode */
+ } else {
+ (*pinode)->i_ino = iunique(sb, 0);
+ }
insert_inode_hash(*pinode);
}
@@ -418,7 +420,7 @@ int cifs_get_inode_info(struct inode **p
/* BB EOPNOSUPP disable SERVER_INUM? */
} else /* do we need cast or hash to ino? */
(*pinode)->i_ino = inode_num;
- } /* else ino incremented to unique num in new_inode*/
+ } /* else ino incremented to unique num in new_inode_autonum*/
insert_inode_hash(*pinode);
}
inode = *pinode;
diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c
index fb18917..b0fad8c 100644
--- a/fs/configfs/inode.c
+++ b/fs/configfs/inode.c
@@ -133,7 +133,7 @@ static inline void set_inode_attr(struct
struct inode * configfs_new_inode(mode_t mode, struct configfs_dirent * sd)
{
- struct inode * inode = new_inode(configfs_sb);
+ struct inode * inode = new_inode_autonum(configfs_sb);
if (inode) {
inode->i_blocks = 0;
inode->i_mapping->a_ops = &configfs_aops;
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index e77676d..331aad9 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -34,7 +34,7 @@ static int debugfs_mount_count;
static struct inode *debugfs_get_inode(struct super_block *sb, int mode, dev_t dev)
{
- struct inode *inode = new_inode(sb);
+ struct inode *inode = new_inode_autonum(sb);
if (inode) {
inode->i_mode = mode;
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index ae228ec..bd64487 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1623,7 +1623,7 @@ static int eventpollfs_delete_dentry(str
static struct inode *ep_eventpoll_inode(void)
{
int error = -ENOMEM;
- struct inode *inode = new_inode(eventpoll_mnt->mnt_sb);
+ struct inode *inode = new_inode_autonum(eventpoll_mnt->mnt_sb);
if (!inode)
goto eexit_1;
diff --git a/fs/freevxfs/vxfs_inode.c b/fs/freevxfs/vxfs_inode.c
index 4786d51..c92df28 100644
--- a/fs/freevxfs/vxfs_inode.c
+++ b/fs/freevxfs/vxfs_inode.c
@@ -261,7 +261,7 @@ vxfs_get_fake_inode(struct super_block *
{
struct inode *ip = NULL;
- if ((ip = new_inode(sbp))) {
+ if ((ip = new_inode_autonum(sbp))) {
vxfs_iinit(ip, vip);
ip->i_mapping->a_ops = &vxfs_aops;
}
diff --git a/fs/fuse/control.c b/fs/fuse/control.c
index 16b39c0..a5caf5a 100644
--- a/fs/fuse/control.c
+++ b/fs/fuse/control.c
@@ -85,7 +85,7 @@ static struct dentry *fuse_ctl_add_dentr
return NULL;
fc->ctl_dentry[fc->ctl_ndents++] = dentry;
- inode = new_inode(fuse_control_sb);
+ inode = new_inode_autonum(fuse_control_sb);
if (!inode)
return NULL;
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 0bea6a6..213c6c0 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -349,7 +349,7 @@ static struct inode *hugetlbfs_get_inode
{
struct inode *inode;
- inode = new_inode(sb);
+ inode = new_inode_autonum(sb);
if (inode) {
struct hugetlbfs_inode_info *info;
inode->i_mode = mode;
diff --git a/fs/jfs/jfs_inode.c b/fs/jfs/jfs_inode.c
index 4c67ed9..cc9a7bc 100644
--- a/fs/jfs/jfs_inode.c
+++ b/fs/jfs/jfs_inode.c
@@ -58,7 +58,7 @@ struct inode *ialloc(struct inode *paren
struct jfs_inode_info *jfs_inode;
int rc;
- inode = new_inode(sb);
+ inode = new_inode_autonum(sb);
if (!inode) {
jfs_warn("ialloc: new_inode returned NULL!");
return ERR_PTR(-ENOMEM);
diff --git a/fs/ocfs2/dlm/dlmfs.c b/fs/ocfs2/dlm/dlmfs.c
index 16b8d1b..f38c914 100644
--- a/fs/ocfs2/dlm/dlmfs.c
+++ b/fs/ocfs2/dlm/dlmfs.c
@@ -325,7 +325,7 @@ static struct backing_dev_info dlmfs_bac
static struct inode *dlmfs_get_root_inode(struct super_block *sb)
{
- struct inode *inode = new_inode(sb);
+ struct inode *inode = new_inode_autonum(sb);
int mode = S_IFDIR | 0755;
struct dlmfs_inode_private *ip;
@@ -352,7 +352,7 @@ static struct inode *dlmfs_get_inode(str
int mode)
{
struct super_block *sb = parent->i_sb;
- struct inode * inode = new_inode(sb);
+ struct inode * inode = new_inode_autonum(sb);
struct dlmfs_inode_private *ip;
if (!inode)
diff --git a/fs/pipe.c b/fs/pipe.c
index b1626f2..fb14bd1 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -839,7 +839,7 @@ static struct dentry_operations pipefs_d
static struct inode * get_pipe_inode(void)
{
- struct inode *inode = new_inode(pipe_mnt->mnt_sb);
+ struct inode *inode = new_inode_autonum(pipe_mnt->mnt_sb);
struct pipe_inode_info *pipe;
if (!inode)
diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c
index 2faf4cd..03573d4 100644
--- a/fs/ramfs/inode.c
+++ b/fs/ramfs/inode.c
@@ -52,7 +52,7 @@ static struct backing_dev_info ramfs_bac
struct inode *ramfs_get_inode(struct super_block *sb, int mode, dev_t dev)
{
- struct inode * inode = new_inode(sb);
+ struct inode * inode = new_inode_autonum(sb);
if (inode) {
inode->i_mode = mode;
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index e79e38d..6dc0e0f 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -123,7 +123,7 @@ static struct lock_class_key sysfs_inode
struct inode * sysfs_new_inode(mode_t mode, struct sysfs_dirent * sd)
{
- struct inode * inode = new_inode(sysfs_sb);
+ struct inode * inode = new_inode_autonum(sysfs_sb);
if (inode) {
inode->i_blocks = 0;
inode->i_mapping->a_ops = &sysfs_aops;
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 7c27400..a8c83e5 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -110,7 +110,7 @@ static struct inode *mqueue_get_inode(st
{
struct inode *inode;
- inode = new_inode(sb);
+ inode = new_inode_autonum(sb);
if (inode) {
inode->i_mode = mode;
inode->i_uid = current->fsuid;
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 6313c38..6dd0156 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -283,7 +283,7 @@ static struct backing_dev_info cpuset_ba
static struct inode *cpuset_new_inode(mode_t mode)
{
- struct inode *inode = new_inode(cpuset_sb);
+ struct inode *inode = new_inode_autonum(cpuset_sb);
if (inode) {
inode->i_mode = mode;
diff --git a/mm/shmem.c b/mm/shmem.c
index 4959535..0d47801 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1354,7 +1354,7 @@ shmem_get_inode(struct super_block *sb,
spin_unlock(&sbinfo->stat_lock);
}
- inode = new_inode(sb);
+ inode = new_inode_autonum(sb);
if (inode) {
inode->i_mode = mode;
inode->i_uid = current->fsuid;
diff --git a/net/socket.c b/net/socket.c
index 6c9b9b3..e8d75f5 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -474,7 +474,7 @@ static struct socket *sock_alloc(void)
struct inode *inode;
struct socket *sock;
- inode = new_inode(sock_mnt->mnt_sb);
+ inode = new_inode_autonum(sock_mnt->mnt_sb);
if (!inode)
return NULL;
diff --git a/security/inode.c b/security/inode.c
index 9b16e14..b1a4e08 100644
--- a/security/inode.c
+++ b/security/inode.c
@@ -58,7 +58,7 @@ static struct file_operations default_fi
static struct inode *get_inode(struct super_block *sb, int mode, dev_t dev)
{
- struct inode *inode = new_inode(sb);
+ struct inode *inode = new_inode_autonum(sb);
if (inode) {
inode->i_mode = mode;
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index cd24441..98493ce 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -766,7 +766,7 @@ out:
static struct inode *sel_make_inode(struct super_block *sb, int mode)
{
- struct inode *ret = new_inode(sb);
+ struct inode *ret = new_inode_autonum(sb);
if (ret) {
ret->i_mode = mode;
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH 0/3] new_inode_autonum: intro -- ensure uniqueness of i_ino and try to prevent st_ino EOVERFLOW in userspace
From: Jeff Layton @ 2006-11-09 15:24 UTC (permalink / raw)
To: linux-fsdevel, linux-kernel, akpm
This started as a rather simple problem. glibc uses fstat64() internally
when making a stat() call. If the st_ino field returned by this call
does not fit in the buffer allocated by the program, glibc (rightly)
generates an EOVERFLOW in userspace. This is generally only a problem
when the program is compiled without -D_FILE_OFFSET_BITS=64.
The kernel declares ino_t to be an unsigned long which is generally
32-bits on 32-bit kernels and 64-bits on 64-bit kernels. The new_inode
function has a static unsigned long counter that it uses to assign out
i_ino values.
On a 64-bit kernel, the value in this counter eventually becomes too
large to fit in 32-bits, and glibc starts throwing EOVERFLOW errors to
programs compiled without large file offsets. This creates a situation
where such a program will work fine on a 32-bit kernel, but when run on
a 64-bit kernel it will eventually start falling down.
We can't do much about this on filesystems that have true 64-bit inodes,
but on filesystems that get "pseudo_inode" values via new_inode or
iunique, we should attempt to make them fit in a 32-bit value.
While fixing this, we discovered that many filesystems seem to blindly
accept the i_ino value given by new_inode. new_inode makes no actual
check to see if an i_ino value is unique, so once the counter overflows
you can end up with more than one inode with the same i_ino value.
The following set of patches should remedy both of these problems. While
these are arguably security-related, these patches are probably better
suited to 2.6.20 than anything earlier.
-- Jeff
^ permalink raw reply
* Re: 2.6.19-rc5 breaks klogd 1.4.1
From: Mike Galbraith @ 2006-11-09 15:25 UTC (permalink / raw)
To: Andrew Morton; +Cc: John Wendel, linux-kernel
In-Reply-To: <1163067064.6145.4.camel@Homer.simpson.net>
On Thu, 2006-11-09 at 11:11 +0100, Mike Galbraith wrote:
> On Wed, 2006-11-08 at 23:35 -0800, Andrew Morton wrote:
>
> > And, predictably, reads from /proc/kmsg aren't blocking.
> >
> > I can't see what might have caused that. Are you sure that 2.6.19-rc4 was
> > OK? And are you sure that nothing else has changed on that system?
>
> Here, both rc4 and rc5 do the same if printk is configured out.
Well duh, of course it does. Testing and _then_ looking at the source
was not the correct order in this case :)
> Why do we have a /proc/ksmg when nothing can get to it?
The sensible thing seemed to be to whack it, but when I did that, klogd
just switched interfaces, and proceeded to eat 100% cpu doing
syslog(0x2, 0xb7fc0008, 0x1ffff) instead. Leaving it in place, but
making it block to simulate an empty buffer works fine, but seems kinda
cheezy.
Whacking /proc/kmsg, and making sys_syslog() block on read to simulate
the empty buffer seemed much better, but SuSE's boot scripts hang when
they try to create /var/log/boot.msg ala /sbin/klogd -s -o -n
-f /var/log/boot.msg. That seems to work now only because there is
always something there to grab.
The correct answer seems to be "fix klogd, or don't disable printk".
-Mike
^ permalink raw reply
* sh_install_xen_entries_in_l3()
From: Jan Beulich @ 2006-11-09 15:24 UTC (permalink / raw)
To: xen-devel
Could someone explain to me the purpose of this function? I'm trying to
understand whether this needs to be called in the context of 32-bit
guests on 64-bit hv (which, for compatibility reasons, need to have a
mirror of the M2P table available in what would be the Xen region on a
32-bit hv).
Thanks, Jan
^ permalink raw reply
* [KVM] ANNOUNCE: new kvm userspace release
From: Avi Kivity @ 2006-11-09 15:23 UTC (permalink / raw)
To: kvm-devel; +Cc: linux-kernel
Changes:
- much easier to get running, see updated HOWTO
- now just one download, get yours while supplies last
- single qemu binary for kvm and non-kvm runs (Anthony Liguori)
- accompanying external kernel module package has all bugfixes folded
in (plus a bit of cosmetics)
http://kvm.sourceforge.net
--
error compiling committee.c: too many arguments to function
^ permalink raw reply
* Re: I would like to propose that we add compression to handle all policy files on disk.
From: Stephen Smalley @ 2006-11-09 15:23 UTC (permalink / raw)
To: Joshua Brindle; +Cc: Daniel J Walsh, SE Linux
In-Reply-To: <1163085214.12241.300.camel@moss-spartans.epoch.ncsc.mil>
On Thu, 2006-11-09 at 10:13 -0500, Stephen Smalley wrote:
> On Thu, 2006-11-09 at 09:34 -0500, Joshua Brindle wrote:
> > Daniel J Walsh wrote:
> > > We are currently storing three sets of pp files on disk in Fedora as
> > > well as a policy.21 file
> > 3 policy.21 files (deceptively named policy.kern in the module store...)
> > plus 2 fully linked copies (base.linked) which is essentially a copy of
> > all the policy packages concatenated (which is much larger than the
> > policy.21 file)
> >
> > As of right now base.linked is unused, we had some plans to eventually
> > use it for 1) verification of the policy via external tools (libsemanage
> > already supports this but noone is using it) and 2) a while back I
> > suggested we could do incremental linking to speed up the process.
> >
> > Getting rid of it almost halves the store size alone:
> >
> > [root@poisonivy targeted]# du -sh modules/
> > 38M modules/
> > [root@poisonivy targeted]# rm modules/*/base.linked
> > [root@poisonivy targeted]# du -sh modules/
> > 21M modules/
> >
> > > To get an idea of how much space we can save, I did this little
> > > experiment. I believe this change is
> > > critical for minimal installs, and if we want to eventually use
> > > SELinux on certain small platforms.
> > >
> > > I think just changing libsemanage to handle compressed policy packages
> > > and to create its itermediary files as compressed files and changing
> > > libselinux able to read a compressed policy.21 file.
> > >
> > libsepol does all the reading and writing, if we were to support
> > compressed policies it would have to be there, not in libsemanage.
> >
> > > # tar cvf /tmp/selinux /etc/selinux/targeted /usr/share/selinux/targeted/
> > there are files in here that we probably wouldn't want to compress like
> > contexts/*, conf files, etc. (granted they are very small compared to
> > policy packages and kernel policy..
> > > # gzip -c /tmp/selinux > /tm/selinux.gz
> > >
> > > # du /tmp/selinux*
> > > 57380 /tmp/selinux
> > > 3772 /tmp/selinux.gz
> >
> > I wouldn't be adverse to someone adding a libsemanage option to not save
> > the previous directory on success, we don't actually provide a revert
> > interface as of now (though we probably should if we are going to keep
> > it around..)
> >
> > [root@poisonivy targeted]# rm -rf modules/previous/
> > [root@poisonivy targeted]# du -sh modules/
> > 11M modules/
> >
> > (this was after the base.linked getting deleted above, add 9 meg to this
> > if we keep that around..)
> >
> > so there we've cut the module directory by 1/4 potentially, just how
> > much space are we needing to save?
> >
> > The main concern I have with this is that libz hasn't had an awesome
> > security record and it would have to be used by the component of the
> > toolchain closest to the kernel, load_policy.
> >
> > Additionally, on Fedora libz is in /usr/lib which means init won't be
> > able to use it to decompress the policy at boot time, I really don't
> > think we should be pulling a static libz into libselinux and libsepol.
>
> Sounds like dropping base.linked and making previous optional would
> address the problem more effectively. Also, do we need to keep
> policy.kern after successful installation of policy.N? If not, we can
> have libsemanage unlink it automatically after installation.
Same question for any other file regenerated by every commit, although
we may not get much of a savings from the others.
file_contexts.template, file_contexts, and netfilter_contexts are the
most obvious ones.
--
Stephen Smalley
National Security Agency
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
^ permalink raw reply
* Re: [patch 0/4] i386, x86_64: fix the irqbalance quirk for E7520/E7320/E7525 - V2
From: Andi Kleen @ 2006-11-09 13:20 UTC (permalink / raw)
To: Siddha, Suresh B; +Cc: akpm, shaohua.li, linux-kernel, discuss, ashok.raj, greg
In-Reply-To: <20061108172017.A10294@unix-os.sc.intel.com>
On Thursday 09 November 2006 02:20, Siddha, Suresh B wrote:
> Mechanism of selecting physical mode in genapic when cpu hotplug is enabled
> on x86_64, broke the quirk(quirk_intel_irqbalance()) introduced for working
> around the transposing interrupt message errata in E7520/E7320/E7525
> (revision ID 0x9 and below. errata #23 in
> http://download.intel.com/design/chipsets/specupdt/30304203.pdf).
>
> This errata requires the mode to be in logical flat, so that interrupts
> can be directed to more than one cpu(and thus use hardware IRQ balancing
> enabled by BIOS on these platforms).
Fine by me. But can you fix the compilation issues Andrew found and resend
please?
-Andi
^ permalink raw reply
* Debian package; trivial fixes
From: Loïc Minier @ 2006-11-09 15:19 UTC (permalink / raw)
To: linux-sparse
[-- Attachment #1: Type: text/plain, Size: 564 bytes --]
Hi,
I've prepared and uploaded a Debian package for sparse 0.1:
<http://people.dooz.org/~lool/debian/sparse/0.1-1/sid-pbuilder/>
FYI, It is currently targetted at Debian "non-free" due to the choice
of venue clause in the license. I think the patent clause is slightly
problematic but might be acceptable for Debian "main".
Please find attached a trivial fix for .gitignore where "check" wasn't
renamed to "sparse".
It would also be more convenient to create BINDIR automatically on make
install.
Bye,
--
Loïc Minier <lool@dooz.org>
[-- Attachment #2: rename-sparse-in-dot-gitignore.patch --]
[-- Type: text/plain, Size: 241 bytes --]
diff --git a/.gitignore b/.gitignore
index 3e12ce7..665ad03 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,9 +11,9 @@ pre-process.h
test-lexing
test-parsing
obfuscate
-check
compile
graph
+sparse
test-dissect
test-linearize
example
[-- Attachment #3: create-bindir.patch --]
[-- Type: text/plain, Size: 550 bytes --]
diff --git a/Makefile b/Makefile
index 2dcd514..920fe67 100644
--- a/Makefile
+++ b/Makefile
@@ -40,18 +40,12 @@ LIBS=$(LIB_FILE)
all: $(PROGRAMS)
-install: $(INST_PROGRAMS) bin-dir
+install: $(INST_PROGRAMS)
+ install -d $(BINDIR)
for f in $(INST_PROGRAMS); do \
install -v $$f $(BINDIR)/$$f || exit 1; \
done
-bin-dir:
- @if ! test -d $(BINDIR); then \
- echo "No '$(BINDIR)' directory to install in"; \
- echo "Please create it and add it to your PATH"; \
- exit 1; \
- fi
-
.PHONY: bin-dir
test-lexing: test-lexing.o $(LIBS)
^ permalink raw reply related
* Re: [PATCH] shorten the x86_64 boot setup GDT to what the comment says
From: Steven Rostedt @ 2006-11-09 15:18 UTC (permalink / raw)
To: Alexander van Heukelum; +Cc: LKML, sct, ak, herbert, xen-devel, heukelum
In-Reply-To: <1163084072.31014.275411753@webmail.messagingengine.com>
On Thu, 9 Nov 2006, Alexander van Heukelum wrote:
> > gdt_48:
> > - .word 0x8000 # gdt limit=2048,
> > + .word 0x800 # gdt limit=2048,
> > # 256 GDT entries
> >
> > .word 0, 0 # gdt base (filled in later)
>
> The limit should be the offset of the last byte of the gdt table. So
> I think what was meant was really 0x7ff. Comparing this code with the
> i386-version, why does x86_64 need 256 entries here, while i386 is happy
> with just the code-segment and data-segment descriptors?
>
Hmm, Andi,
Should this be more like what is done in x86? Although this isn't a major
bug or anything, would it be cleaner. For example doing:
@@ -836,11 +836,15 @@ gdt:
.word 0x9200 # data read/write
.word 0x00CF # granularity = 4096, 386
# (+5th nibble of limit)
+gdt_end:
+ .align 4
+
+ .word 0 # alignment byte
idt_48:
.word 0 # idt limit = 0
.word 0, 0 # idt base = 0L
gdt_48:
- .word 0x8000 # gdt limit=2048,
+ .word gdt_end - gdt - 1 # gdt limit=2048,
# 256 GDT entries
.word 0, 0 # gdt base (filled in
instead?
If so, I can send you another patch that does this. Will need to test it
first.
-- Steve
^ permalink raw reply
* Re: Abysmal PATA IDE performance
From: Alessandro Suardi @ 2006-11-09 15:17 UTC (permalink / raw)
To: Stephen.Clark
Cc: Arjan van de Ven, "\"J.A.\" Magallón",
Björn Steinbrink, Mark Lord, linux-kernel, alan
In-Reply-To: <45533DB9.4000405@seclark.us>
On 11/9/06, Stephen Clark <Stephen.Clark@seclark.us> wrote:
> Arjan van de Ven wrote:
>
> >>Probably your drives are renamed.
> >>Before you had (wild guess, look at your boot log messages):
> >>- ata bus -> hdc,hdd
> >>- sata -> sda (if you really have any sata bus...)
> >>
> >>Now all hdX become sdX, and PATA is detected _before_ SATA, so you names
> >>probaly became:
> >>- ata via libata -> sda (HD), sr0 (CDROM)
> >>- sata -> sdb.
> >>
> >>
> >
> >on fedora this doesn't matter (due to mount-by-label)
> >
> >the bigger problem I suspect is that the sata modules aren't part of the
> >initrd!
> >
> >you can force the issue by adding
> >
> >alias scsi_hostadapter1 ata_piix
> >
> >to the /etc/modprobe.conf file, and then recreating the initrd
> >(see the mkinitrd tool, or just install the kernel rpm)
> >
> >
> >
> >
> >
> >
> Thanks all.
>
> Arjan, using combined_mode=libata and making a new ramdisk increased my
> xfer rate from 1.xx mb/sec to 28.xx mb/sec.
>
> I am curious as to why my friends dell inspiron 8200 with a 1.8ghz p4
> and the same drive using the same drive with FC6 and the standard ide
> module gets 44 to 45 mb/sec.
The figures are so similar to the problem I recently posted that you
might want to give a shot at unloading ehci_hcd module, then try
again getting performance numbers from the IDE disk. In my case
unloading ehci_hcd boosts IDE performance from 20 to 40MB/s
(but of course kills USB2 disk performance).
--alessandro
"...when I get it, I _get_ it"
(Lara Eidemiller)
^ permalink raw reply
* Re: Problem with multiple mounts
From: Lennart Sorensen @ 2006-11-09 15:15 UTC (permalink / raw)
To: Suzuki, reiserfs-list, lkml, Jan Kara
In-Reply-To: <20061108230623.GZ6012@schatzie.adilger.int>
On Wed, Nov 08, 2006 at 04:06:23PM -0700, Andreas Dilger wrote:
> I would suggest that even while this is not supported, it would be prudent
> to fix such a bug. It might be possible to hit a similar problem if there
> is corruption of the on-disk data in the journal and oopsing the kernel
> isn't a graceful way to deal with bad data on disk.
On the other hand corrupt data at least doesn't change under you while
you are trying to figure out the filesystem. This particular use would
have meta data changing while you are trying to read it, making things
not be consistent with each other from one moment to another. There may
be nothing that can be done about it.
--
Len Sorensen
^ permalink raw reply
* Re: [PATCH] shorten the x86_64 boot setup GDT to what the comment says
From: Andi Kleen @ 2006-11-09 13:13 UTC (permalink / raw)
To: Steven Rostedt; +Cc: LKML, sct, herbert, xen-devel
In-Reply-To: <Pine.LNX.4.58.0611082144410.17812@gandalf.stny.rr.com>
> Stephen Tweedie has written up a patch to fix the Xen side and will be
> submitting that to those folks. But that doesn't excuse the GDT limit
> being a magnitude too big.
Added thanks
-Andi
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
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.