public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* IMA and ETXTBSY
@ 2009-06-18  5:32 hooanon05
  2009-06-18 23:49 ` Mimi Zohar
  0 siblings, 1 reply; 2+ messages in thread
From: hooanon05 @ 2009-06-18  5:32 UTC (permalink / raw)
  To: zohar; +Cc: linux-kernel


After the failure of open(2) with ETXTBSY, IMA produces wrong messages.
Here is a simple test script.

dir=/tmp
cp /bin/sleep $dir
ls -l $dir/sleep
stat -f $dir
$dir/sleep 3 & sleep 1
echo | /bin/dd of=$dir/sleep conv=notrunc && false
wait
rm $dir/sleep


The result.
+ cp /bin/sleep /tmp
+ ls -l /tmp/sleep
-rwxr-xr-x 1 jro jro 23504 Jun 18 14:26 /tmp/sleep
+ stat -f /tmp
  File: "/tmp"
    ID: 4e22c34ea8177d80 Namelen: 255     Type: ext2/ext3
Block size: 1024       Fundamental block size: 1024
Blocks: Total: 918322     Free: 918281     Available: 869285
Inodes: Total: 490560     Free: 490545
+ /tmp/sleep 3
+ sleep 1
+ echo
+ /bin/dd of=/tmp/sleep conv=notrunc
/bin/dd: opening `/tmp/sleep': Text file busy
+ wait
+ rm /tmp/sleep
$ iint_free: writecount: 1
iint_free: opencount: 1


J. R. Okajima

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: IMA and ETXTBSY
  2009-06-18  5:32 IMA and ETXTBSY hooanon05
@ 2009-06-18 23:49 ` Mimi Zohar
  0 siblings, 0 replies; 2+ messages in thread
From: Mimi Zohar @ 2009-06-18 23:49 UTC (permalink / raw)
  To: hooanon05; +Cc: linux-kernel, safford

hooanon05@yahoo.co.jp wrote on 06/18/2009 01:32:58 AM:

> After the failure of open(2) with ETXTBSY, IMA produces wrong messages.
> Here is a simple test script.
> 
> dir=/tmp
> cp /bin/sleep $dir
> ls -l $dir/sleep
> stat -f $dir
> $dir/sleep 3 & sleep 1
> echo | /bin/dd of=$dir/sleep conv=notrunc && false
> wait
> rm $dir/sleep
> 
> 
> The result.
> + cp /bin/sleep /tmp
> + ls -l /tmp/sleep
> -rwxr-xr-x 1 jro jro 23504 Jun 18 14:26 /tmp/sleep
> + stat -f /tmp
>   File: "/tmp"
>     ID: 4e22c34ea8177d80 Namelen: 255     Type: ext2/ext3
> Block size: 1024       Fundamental block size: 1024
> Blocks: Total: 918322     Free: 918281     Available: 869285
> Inodes: Total: 490560     Free: 490545
> + /tmp/sleep 3
> + sleep 1
> + echo
> + /bin/dd of=/tmp/sleep conv=notrunc
> /bin/dd: opening `/tmp/sleep': Text file busy
> + wait
> + rm /tmp/sleep
> $ iint_free: writecount: 1
> iint_free: opencount: 1
> 
> 
> J. R. Okajima

The problem is that IMA measures the file and increments the 
open/read/write counters before the file is actually opened,
but if the open fails it doesn't decrement the counters.  I'll
post a patch. Thanks for bringing this to my attention.

Mimi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-18 23:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-18  5:32 IMA and ETXTBSY hooanon05
2009-06-18 23:49 ` Mimi Zohar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox