Re: Read operation

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

 



On Mon, Jan 5, 2009 at 6:03 PM, rohit vashist
<rohitvashist2kk3@xxxxxxxxx> wrote:
> Hi
>
> Suppose i do a read operation on a file which is on some xyz device.And this
> device is mounted with some flag may be MS_READONLY,MS_REMOUNT.Now if i do a
> write operation on this device i m not allowed to do so because the it has
> been mounted as read only.
> My question is when read system call occurs where does it check that flag
> i.e is it after vfs_read() or in generic_file_read()?

Hi,

Hope this answers your question

[root@localhost testext2]# echo hi > a

Breakpoint 3, mnt_want_write (mnt=0x27852a10) at fs/namespace.c:259
259		if (__mnt_is_readonly(mnt)) {
(gdb) bt
#0  mnt_want_write (mnt=0x27852a10) at fs/namespace.c:259
#1  0x080c213c in do_filp_open (dfd=-100, pathname=0x24241000 "a",
open_flag=33345, mode=438) at fs/namei.c:1746
#2  0x080b5df9 in do_sys_open (dfd=-100, filename=0x811e7c8 "",
flags=33345, mode=438) at fs/open.c:1018
#3  0x080b5ea6 in sys_open (filename=0x811e7c8 "", flags=33345,
mode=438) at fs/open.c:1039
#4  0x0805a4e8 in handle_syscall (r=0x27b45214) at
arch/um/kernel/skas/syscall.c:35
#5  0x080686a2 in userspace (regs=0x27b45214) at
arch/um/os-Linux/skas/process.c:201
#6  0x0805774e in fork_handler () at arch/um/kernel/process.c:179
#7  0x00000000 in ?? ()
(gdb) n
269	}
(gdb)
do_filp_open (dfd=-100, pathname=0x24241000 "a", open_flag=33345,
mode=438) at fs/namei.c:1747
1747			if (error)
(gdb) p error
$5 = -30
(gdb) p EROFS
$6 = 30
(gdb) c
Continuing.
-bash: a: Read-only file system


Thanks -
Manish


>
>
>
> --
> Regards
> Vashist
>

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[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