* [LTP] [PATCH] acl_test01: sync after removal of the loop device
@ 2014-10-22 8:12 Stanislav Kholmanskikh
2014-10-30 13:47 ` Cyril Hrubis
0 siblings, 1 reply; 2+ messages in thread
From: Stanislav Kholmanskikh @ 2014-10-22 8:12 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
If the test is executed on NFS, it may fail with:
/dev/loop0 on /tmpdir/tacl/mount-ext3 type ext3 (rw,acl,user_xattr)
loop: can't delete device /dev/loop0: No such device or address
rm: cannot remove `/tmpdir/tacl': Directory not empty
loop: can't delete device /dev/loop0: No such device or address
rm: cannot remove `/tmpdir/tacl/.nfs00000000000262fd00000115': Device or resource busy
I suppose that this happens because of kernel commit:
commit a1ecac3b0656a68259927c234e505804d33a7b83
Author: Dave Chinner <dchinner@redhat.com>
Date: Fri Sep 28 10:42:23 2012 +0200
loop: Make explicit loop device destruction lazy
To cope with this test case failure I introduced a 'sync'.
And 'losetup -d' seems to be unnecessary, because of 'umount -d' before it
Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
---
testcases/kernel/fs/acls/acl_test01 | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/testcases/kernel/fs/acls/acl_test01 b/testcases/kernel/fs/acls/acl_test01
index af65213..9568918 100755
--- a/testcases/kernel/fs/acls/acl_test01
+++ b/testcases/kernel/fs/acls/acl_test01
@@ -89,7 +89,7 @@ do_cleanup() {
rm -f $FILE_ACL > /dev/null 2>&1
rm -f $FILE_ACL_LINK > /dev/null 2>&1
mount | grep "$TMP/tacl/mount-ext3" && umount -d $TMP/tacl/mount-ext3
- [ "x$LOOP_DEV" != x ] && losetup -d $LOOP_DEV
+ sync
rm -rf $TMP/tacl
}
--
1.7.1
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [LTP] [PATCH] acl_test01: sync after removal of the loop device
2014-10-22 8:12 [LTP] [PATCH] acl_test01: sync after removal of the loop device Stanislav Kholmanskikh
@ 2014-10-30 13:47 ` Cyril Hrubis
0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2014-10-30 13:47 UTC (permalink / raw)
To: Stanislav Kholmanskikh; +Cc: vasily.isaenko, ltp-list
> If the test is executed on NFS, it may fail with:
>
> /dev/loop0 on /tmpdir/tacl/mount-ext3 type ext3 (rw,acl,user_xattr)
> loop: can't delete device /dev/loop0: No such device or address
> rm: cannot remove `/tmpdir/tacl': Directory not empty
> loop: can't delete device /dev/loop0: No such device or address
> rm: cannot remove `/tmpdir/tacl/.nfs00000000000262fd00000115': Device or resource busy
>
> I suppose that this happens because of kernel commit:
>
> commit a1ecac3b0656a68259927c234e505804d33a7b83
> Author: Dave Chinner <dchinner@redhat.com>
> Date: Fri Sep 28 10:42:23 2012 +0200
>
> loop: Make explicit loop device destruction lazy
>
> To cope with this test case failure I introduced a 'sync'.
> And 'losetup -d' seems to be unnecessary, because of 'umount -d' before it
Hmm, so we umount and detach a filesystem but fail to delete it on NFS
because somebody else (presumbly udev) keeps the refcount there?
If that was the the problem the detach would have failed with EBUSSY
previously and the test would fail to delete the file anyway.
I do not fully understand why we need to do the sync there. The kernel
has changed not to report error on detach when somebody else keeps
working with the loop device and sets AUTOCLEAR flag that detaches the
loop device on last closed filedescriptor that references it. Does NFS
keep special file descriptor that prevents the loop device from being
detached?
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-10-30 13:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-22 8:12 [LTP] [PATCH] acl_test01: sync after removal of the loop device Stanislav Kholmanskikh
2014-10-30 13:47 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox