Re: Writing to a file from kernel

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

 



Amit Kapoor wrote:
> 
> Hi,
> 
>   I am having a weird problem writing to a file from the kernel.  At the
> statement ' file->f_op->write(...)' the module just seems to hang during
> insmod.  Could anyone tell me why this might be the case?  The code is
> pasted below.
> 
> ...
>         inode = file->f_dentry->d_inode;
>         down(&inode->i_sem);
> 

You shouldn't take i_sem here.  see generic_file_write().

-
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux