Questions about data protection in the kernel

2022-03-03 Thread Kai Meyer
6eb-909b-300e3f3e47a1.jpg]<https://arcserve.com/> Kai Meyer | Sr. Software Engineer Office: 801.871.2765 | Mobile: | kai.me...@arcserve.com arcserve.com<https://www.arcserve.com/> | Twitter<https://twitter.com/Arcserve> | LinkedIn<https://www.linkedin

Re: VFAT i_pos value

2011-12-08 Thread Kai Meyer
On 12/02/2011 11:23 PM, OGAWA Hirofumi wrote: > OGAWA Hirofumi writes: > >> Kai Meyer writes: >> >>> Thanks for the helpful response. I'm not entirely sure I understand the >>> next part though. I hacked a dirty entry dumper tool: >>> &

Re: What does inconsistent lock state mean?

2011-12-08 Thread Kai Meyer
On 12/08/2011 07:47 AM, Srivatsa Bhat wrote: 2 things: 1. Documentation/lockdep-design.txt explains the "cryptic lock state symbols". 2. Please post the lockdep splat _exactly_ as it appears, and _in full_ (and without line-wrapping, if possible). Usually lockdep is intelligent enough

What does inconsistent lock state mean?

2011-12-07 Thread Kai Meyer
I'm getting this when I try to spin_unlock a recently acquired lock with spin_lock. IRQs are still somewhat of a mystery to me, and cryptic lock state symbols (IN-HARDIRQ-W, HARDIRQ-ON-W) are unintelligible to me. Dec 7 15:52:20 dev2 kernel: = Dec 7 15:52:20 dev

Re: VFAT i_pos value

2011-12-01 Thread Kai Meyer
On 12/01/2011 12:20 PM, OGAWA Hirofumi wrote: > Kai Meyer writes: > >>> The i_pos means directory entry (contains inode information in unix-fs) >>> position, >>> >>> block number == i_pos / (logical-blocksize / 32) >>> offset

Re: Understanding kmap/kunmap

2011-12-01 Thread Kai Meyer
Correction. The problem occurs when 8 bios of size 512 with 1 bvec each all share the same page. I made a bad assumption previously. -Kai Meyer On 12/01/2011 10:49 AM, Kai Meyer wrote: > I want to be able to copy data into a struct bio *, so I use > bio_for_each_segment to loop throug

Understanding kmap/kunmap

2011-12-01 Thread Kai Meyer
umentation or high level explanation of kmap/kunmap or other ideas to try are welcome. -Kai Meyer ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Re: VFAT i_pos value

2011-12-01 Thread Kai Meyer
On 12/01/2011 07:38 AM, OGAWA Hirofumi wrote: > Kai Meyer writes: > >> I'm getting this error: >> FAT: Filesystem error (dev sblsnap0) >> fat_get_cluster: invalid cluster chain (i_pos 523791) >> >> I'm wondering if there was a way to figure ou

VFAT i_pos value

2011-11-30 Thread Kai Meyer
. Is there a straight forward way to convert i_pos to a sector value? I've been staring at the fat.c and fat.h code all morning, and I'm having trouble grok'ing the flow. -Kai Meyer ___ Kernelnewbies mailing list Kernelnewbi

Freeing work_struct memory

2011-11-21 Thread Kai Meyer
ker *worker" inside worker_fn? Or does the work_queue stuff need to continue to use the "struct work_struct work" member after the end of worker_fn? -Kai Meyer ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Re: Generic I/O

2011-11-15 Thread Kai Meyer
On 11/15/2011 11:13 AM, mic...@michaelblizek.twilightparadox.com wrote: > Hi! > > On 12:15 Mon 14 Nov , Kai Meyer wrote: > ... > >> My >> caller function has an atomic_t value that I set equal to the number of >> bios I want to submit. Then I pass a pointer t

Generic I/O

2011-11-14 Thread Kai Meyer
me like I'm re-inventing a wheel here. Are there mechanisms that are better suited for waiting for tasks to complete? Or even for generic block I/O functions? -Kai Meyer ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Re: Spinlocks and interrupts

2011-11-14 Thread Kai Meyer
On 11/10/2011 11:58 PM, Rajat Sharma wrote: > For most of the block drivers bio_endio runs in a context of its > tasklet, so it is indeed atomic context. > > -Rajat > > On Fri, Nov 11, 2011 at 4:50 AM, Kai Meyer wrote: >> >> On 11/10/2011 04:00 PM, Jeff Haran wro

Re: Spinlocks and interrupts

2011-11-10 Thread Kai Meyer
On 11/10/2011 04:00 PM, Jeff Haran wrote: >> -Original Message- >> From: kernelnewbies-boun...@kernelnewbies.org [mailto:kernelnewbies- >> boun...@kernelnewbies.org] On Behalf Of Kai Meyer >> Sent: Thursday, November 10, 2011 1:55 PM >> To: kernelnewbies@ke

Re: Spinlocks and interrupts

2011-11-10 Thread Kai Meyer
t choice? In addition, I'd like to be more confident in my assumptions above. Can I test for atomic context? For instance, I know that you can call irqs_disabled(), is there a similar is_atomic() function I can call? I would like to put a few calls in different places to learn what sort of

Re: Spinlocks and interrupts

2011-11-10 Thread Kai Meyer
more about the context in which my endio function is being called. On 11/10/2011 11:02 AM, Kai Meyer wrote: > Well, I changed my code to use a mutex instead of a spinlock, and now I get: > BUG: scheduling while atomic: swapper/0/0x1001 > All I changed was the spinlock_t to a struct mu

Re: Spinlocks and interrupts

2011-11-10 Thread Kai Meyer
x27;m confused. What does mutex_lock do besides set values in an atomic_t? -Kai Meyer On 11/10/2011 10:02 AM, Kai Meyer wrote: > > On 11/09/2011 08:38 PM, Dave Hylands wrote: >> Hi Kai, >> >> On Wed, Nov 9, 2011 at 3:12 PM, Kai Meyer wrote: >>> Ok, I need mutual exclu

Re: Spinlocks and interrupts

2011-11-10 Thread Kai Meyer
On 11/09/2011 08:38 PM, Dave Hylands wrote: > Hi Kai, > > On Wed, Nov 9, 2011 at 3:12 PM, Kai Meyer wrote: >> Ok, I need mutual exclusion on a data structure regardless of interrupts >> and core. It sounds like it can be done by using a spinlock and >> disabling inter

Re: Spinlocks and interrupts

2011-11-09 Thread Kai Meyer
I use a bitmap to indicate that alloc_data has completed. I also need to protect alloc_data from being run multiple times, so I use the spin_lock to ensure that test_bit (and possibly retrieve_data) is not run while alloc_data is being run (because it runs while the bit is cleared). -Kai Meyer

Spinlocks and interrupts

2011-11-09 Thread Kai Meyer
When I readup on spinlocks, it seems like I need to choose between disabling interrupts and not. If a spinlock_t is never used during an interrupt, am I safe to leave interrupts enabled while I hold the lock? (Same question for read/write locks if it is different.) -Kai Meyer

generic I/O

2011-11-03 Thread Kai Meyer
ite' functions. If they don't exist, I would probably end up writing functions like: int blk_read(struct block_device *bdev, void *buffer, off_t length); int blk_write(struct block_device *bdev, void *buffer, off_t length); Pros and co

Re: Trouble removing character device

2011-10-20 Thread Kai Meyer
I do call unregister_chrdev_region. There are 5 functions in my original email that I call during the life of my module. Still no luck. -Kai Meyer On 10/19/2011 09:47 PM, rohan puri wrote: On Thu, Oct 20, 2011 at 2:25 AM, Kai Meyer <mailto:k...@gnukai.com>> wrote: Unfort

Re: Understanding memcpy

2011-10-20 Thread Kai Meyer
Thanks for catching that :) I knew it would be something simple. On 10/19/2011 10:00 PM, rohan puri wrote: On Thu, Oct 20, 2011 at 3:04 AM, Kai Meyer <mailto:k...@gnukai.com>> wrote: I'm trying to poke around an ext4 file system. I can submit a bio for the correct bloc

Understanding memcpy

2011-10-19 Thread Kai Meyer
I'm trying to poke around an ext4 file system. I can submit a bio for the correct block, and read in what seems to be the correct information, but when I try to memcpy my char *buffer to a reference to a struct I've made, it just doesn't seem to work. The relevant code looks like this: typedef

Re: Trouble removing character device

2011-10-19 Thread Kai Meyer
r now). -Kai Meyer On 10/19/2011 02:18 PM, Daniel Baluta wrote: > On Wed, Oct 19, 2011 at 7:04 PM, Kai Meyer wrote: >> I can't seem to get my character device to remove itself from the >> /proc/devices list. I'm calling all of the following functions like so: >&g

Trouble removing character device

2011-10-19 Thread Kai Meyer
just like I do. To be clear, after I unload my module (after calling cdev_del and unregister_chrdev_region), my "my_char" string still shows up in /proc/devices. -Kai Meyer ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Re: how diff between hardlink trees works?

2011-09-09 Thread Kai Meyer
On 09/09/2011 12:39 PM, Vaibhav Jain wrote: On Fri, Sep 9, 2011 at 11:12 AM, Kai Meyer <mailto:k...@gnukai.com>> wrote: On 09/09/2011 09:05 AM, Vaibhav Jain wrote: Hi, I am not able to understand how diff between two trees of which one is just contains har

Re: how diff between hardlink trees works?

2011-09-09 Thread Kai Meyer
t way the diff will work. Otherwise, skip the hard link part all together, and just make a full copy. Uses lots of disk space and takes longer to diff. -Kai Meyer ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewb

Filesystem allocation bitmap

2011-09-08 Thread Kai Meyer
Ext4_Disk_Layout and then read the bitmaps directly from disk", I think I can deal with that too. -Kai Meyer ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Re: Query about custom fedora build process

2011-09-08 Thread Kai Meyer
, but I don't know of any. My suggestion would be to hardlink the entire source tree, and then afterwards delete the destination hard links for the files you want to modify, and re-copy (normal copy) the original files again. -Kai Meyer On 09/07/2011 04:16 PM, Vaibhav Jain wrote: Hi, I am trying