[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[linux-lvm] Yet another patch to lvm_dir_cache.c





linux-2.4-test5 problem.

lvm_dir_cache.c has a minor problem when it scans the output of /proc/partitions. It does not correctly skip the rest of the line. The following patch fixes this problem:


[root xfs lib]# diff -c lvm_dir_cache.c.orig lvm_dir_cache.c *** lvm_dir_cache.c.orig Mon Feb 21 20:09:32 2000 --- lvm_dir_cache.c Thu Aug 3 11:11:04 2000 *************** *** 83,91 **** }

     if ( dir_cache == NULL) {
!       if ( ( proc = fopen ( "/proc/partitions", "r")) != NULL) {
           while ( !feof ( proc)) {
!              fscanf ( proc, " %s %s %s %s\n", major, minor, blocks, devname);
               if ( atoi ( major) > 0 && atoi ( major) != LVM_BLK_MAJOR) {
                  lvm_add_dir_cache ( "/dev", devname);
               }
--- 83,91 ----
     }

if ( dir_cache == NULL) {
! if (( proc = fopen ( "/proc/partitions", "r")) != NULL) {
while ( !feof ( proc)) {
! fscanf ( proc, " %s %s %s %s%*[^\n]s\n", major, minor, blocks, devname);
if ( atoi ( major) > 0 && atoi ( major) != LVM_BLK_MAJOR) {
lvm_add_dir_cache ( "/dev", devname);
}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]