Re: [PATCH] btrfs: treat -ERANGE as an error case in btrfs_get_acl()

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

 



On 06/22/2018 06:48 PM, David Sterba wrote:
On Fri, Jun 22, 2018 at 10:58:16AM +0800, Chengguang Xu wrote:
Currently, when encoutering -ERANGE in btrfs_get_acl(),
just set acl to NULL so that we cannot get proper
acl information but the operation looks successful.
Do you have a reproducer for that?

ERANGE is returned from btrfs_getxattr in case the buffer is not large
enough to store the restult, but the first call to btrfs_getxattr will
read the size and then a temporary buffer of that size is allocated.

So ERANGE should not be able to make it to the the condition at all.
Yes, I think you are right.

It might only happen in distributed filesystems(like cephfs) by concurrent
set/get from different clients, so in this case, checking -ERANGE condition
is reasonable(can add retry or some other error handlings) but the check
seems meaningless for local filesystems.

I have tested on some local filesystems before posting patch and found
there is no chance to make it to the -ERANGE condition. Even if we can
get into that condition set acl to NULL looks not correct.

In any case, I think we should remove the check 'size == -ERANGE' in btrfs_gat_acl(),
maybe I should change commit log to avoid misunderstanding.


Thanks,
Chengguang.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux