xfs
[Top] [All Lists]

Re: sys_acl_get locking files forever

To: Hasch@xxxxxxxxxxx (Juergen Hasch)
Subject: Re: sys_acl_get locking files forever
From: Steve Lord <lord@xxxxxxx>
Date: Sun, 22 Apr 2001 11:18:41 -0500
Cc: XFS-Mailingliste <linux-xfs@xxxxxxxxxxx>, John Trostel <jtrostel@xxxxxxxxxx>
In-reply-to: Message from Hasch@t-online.de (Juergen Hasch) of "Sun, 22 Apr 2001 16:31:52 +0200." <3AE2EB58.FF2516BD@t-online.de>
Sender: owner-linux-xfs@xxxxxxxxxxx
> Hello,
> 
> I am facing similar problems John Trostel is seeing, using XFS ACLs.
> To investigate this, I have written a simple test program using libacl:
>   fd = open("testfile",O_RDONLY);
>   acl_get_fd(fd);
>   close(fd);
> 
> After executing this on a XFS or EXT2 partition, the partition
> can't be unmounted any more (device busy). Removing files
> also won't free up any space.
> 
> I traced the problem down to sys_acl_get() in fs/posix_acl.c,
> where fget() is called without fput() afterwards. If I understand
> this correctly, using fget() increases file->count, so one has to
> use fput() to decrease the counter again:
> 
>               struct file * f = fget (fdes);
>               if (f)
>                         {
>                       dentry = f->f_dentry;
>                       fput(f);
>                         }
> 
> After adding fput(f) as shown above, all seems to work fine.
> Maybe someone can comment if this fix is correct ?
> 
> ... Juergen

Yep, this whole problem smells of reference counts not being released, and
the file descriptor version of the acl code certainly seems to be buggy. Here
is a variation on your fix - we really want to keep the reference on the
file while manipulating the acl. Let me know if this fixes your problems
and I will put this in cvs.

Steve



Attachment: acl.patch
Description: acl.patch

<Prev in Thread] Current Thread [Next in Thread>