xfs
[Top] [All Lists]

sys_acl_get locking files forever

To: XFS-Mailingliste <linux-xfs@xxxxxxxxxxx>
Subject: sys_acl_get locking files forever
From: Hasch@xxxxxxxxxxx (Juergen Hasch)
Date: Sun, 22 Apr 2001 16:31:52 +0200
Cc: John Trostel <jtrostel@xxxxxxxxxx>
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

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