[Gluster-Maintainers] Improve robustness by checking result of pthread_mutex_lock()

Niels de Vos ndevos at redhat.com
Mon Aug 29 19:16:12 UTC 2016


On Mon, Aug 29, 2016 at 02:41:40PM -0400, Shyam wrote:
> On 08/28/2016 07:14 AM, Niels de Vos wrote:
> > Hi,
> > 
> > While working on some code, I notices that there are quite some calls to
> > pthread_mutex_lock() that do not check for the return value. There might
> > be cases where obtaining the lock fails, and in many cases this would
> > just be ignored. Needless to say, this might cause incorrect updates to
> > the data structures that the pthread_mutex intends to prevent.
> > 
> > I have filed https://bugzilla.redhat.com/1370921 for this issue, but may
> > add more dependent bugs for different components. What do other
> > maintainers prefer to use for tracking corrections like this?
> 
> Short answer: a bug report
> 
> Long answer: A bug is most favorable, so that when considering backlog for a
> component, such changes are also seen and prioritized. I would like a bug
> for everything that we see needs an improvement to an actual problem-fix, so
> that we can consider them in totality.
> 
> In this case a bug does suit the needs.
> 
> In possibly some cases, where it is an improvement that is not necessarily a
> bug, I would like to post this in a wish list of sorts for the component (or
> the entire project). Primarily not a bug report, because in any bug backlog
> clearing activity I do not want these closed as not a bug or some such.
> 
> Such a wishlist is possibly a trello backlog board/list, with an easier
> update+view for all community members (rather than actually visiting Trello
> if possible). This is not a part of this discussion I believe, so feel free
> to ignore this for the moment if you choose to.

Actually, if a bug has the FutureFeature keyword set, it gets marked
with 'Wishlist' (priority) on http://bugs.cloud.gluster.org/ :)

A single place where we can create things to track has my preference. I
think Bugzilla is most suitable. We can have multiple interfaces,
queries and reports to display different aspects of component
maintenance.

Niels

> 
> > 
> > Thanks,
> > Niels
> > 
> > 
> >     $ git grep pthread_mutex_lock '*.[ch]' \
> >         | grep -v '= pthread_mutex_lock' | cut -d : -f 1 | uniq -c \
> >         | sort -rn
> >      28 xlators/features/locks/src/posix.c
> >      27 rpc/rpc-lib/src/rpc-clnt.c
> >      23 rpc/rpc-transport/rdma/src/rdma.c
> >      19 rpc/rpc-transport/socket/src/socket.c
> >      19 libglusterfs/src/logging.c
> >      19 libglusterfs/src/inode.c
> >      16 xlators/features/bit-rot/src/bitd/bit-rot-scrub.c
> >      16 xlators/features/bit-rot/src/bitd/bit-rot.c
> >      15 libglusterfs/src/syncop.c
> >      14 xlators/mount/fuse/src/fuse-bridge.c
> >      14 rpc/rpc-lib/src/rpcsvc.c
> >      13 xlators/features/locks/src/entrylk.c
> >      11 xlators/features/leases/src/leases-internal.c
> >      11 xlators/cluster/dht/src/tier.c
> >      10 xlators/features/locks/src/inodelk.c
> >       8 xlators/protocol/client/src/client.c
> >       8 libglusterfs/src/fd.c
> >       8 libglusterfs/src/event-epoll.c
> >       7 xlators/protocol/client/src/client-handshake.c
> >       7 xlators/cluster/dht/src/dht-rebalance.c
> >       7 libglusterfs/src/event-poll.c
> >       6 xlators/protocol/server/src/server.c
> >       6 xlators/protocol/client/src/client-lk.c
> >       6 libglusterfs/src/iobuf.c
> >       5 xlators/features/upcall/src/upcall-internal.c
> >       5 xlators/features/locks/src/reservelk.c
> >       5 xlators/features/locks/src/common.c
> >       5 xlators/features/locks/src/clear.c
> >       5 xlators/features/changelog/lib/src/gf-changelog-reborp.c
> >       5 rpc/rpc-lib/src/rpc-clnt-ping.c
> >       4 xlators/protocol/client/src/client-rpc-fops.c
> >       4 xlators/performance/io-threads/src/io-threads.c
> >       4 xlators/performance/io-cache/src/io-cache.h
> >       4 xlators/mgmt/glusterd/src/glusterd.c
> >       4 xlators/features/bit-rot/src/bitd/bit-rot-scrub-status.c
> >       4 xlators/cluster/ec/src/ec-heald.c
> >       4 xlators/cluster/afr/src/afr-self-heald.c
> >       4 libglusterfs/src/syncop-utils.c
> >       4 cli/src/cli-cmd.c
> >       4 api/src/glfs.c
> >       3 xlators/storage/posix/src/posix.c
> >       3 xlators/performance/read-ahead/src/read-ahead.h
> >       3 xlators/mgmt/glusterd/src/glusterd-utils.c
> >       3 xlators/features/protect/src/prot_dht.c
> >       3 xlators/features/changelog/src/changelog-helpers.c
> >       3 tools/gfind_missing_files/gcrawler.c
> >       3 libglusterfs/src/event.c
> >       3 libglusterfs/src/circ-buff.c
> >       3 api/src/glfs-resolve.c
> >       3 api/src/glfs-mgmt.c
> >       3 api/src/glfs-master.c
> >       3 api/src/glfs-handleops.c
> >       3 api/src/glfs-fops.c
> >       2 xlators/storage/posix/src/posix-helpers.c
> >       2 xlators/mount/fuse/src/fuse-helpers.c
> >       2 xlators/mgmt/glusterd/src/glusterd-syncop.c
> >       2 xlators/mgmt/glusterd/src/glusterd-statedump.c
> >       2 xlators/mgmt/glusterd/src/glusterd-mgmt.c
> >       2 xlators/mgmt/glusterd/src/glusterd-hooks.c
> >       2 xlators/features/index/src/index.c
> >       2 xlators/features/changelog/src/changelog-ev-handle.c
> >       2 xlators/features/changelog/lib/src/gf-changelog-journal-handler.c
> >       2 xlators/features/bit-rot/src/stub/bit-rot-stub-helpers.c
> >       2 xlators/features/bit-rot/src/stub/bit-rot-stub.c
> >       2 xlators/experimental/fdl/src/fdl-tmpl.c
> >       2 rpc/rpc-lib/src/rpc-transport.c
> >       2 libglusterfs/src/throttle-tbf.c
> >       2 libglusterfs/src/syncop.h
> >       2 libglusterfs/src/rot-buffs.c
> >       2 libglusterfs/src/locking.h
> >       1 xlators/protocol/server/src/server-helpers.c
> >       1 xlators/protocol/client/src/client-helpers.c
> >       1 xlators/nfs/server/src/nfs-fops.c
> >       1 xlators/features/trash/src/trash.c
> >       1 xlators/features/leases/src/leases.h
> >       1 xlators/features/changelog/lib/src/gf-changelog.c
> >       1 xlators/cluster/dht/src/dht-shared.c
> >       1 xlators/cluster/afr/src/afr-transaction.c
> >       1 libglusterfs/src/statedump.c
> >       1 extras/benchmarking/rdd.c
> >       1 api/src/glfs-internal.h
> > 
> > 
> > 
> > _______________________________________________
> > maintainers mailing list
> > maintainers at gluster.org
> > http://www.gluster.org/mailman/listinfo/maintainers
> > 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://www.gluster.org/pipermail/maintainers/attachments/20160829/26701877/attachment.sig>


More information about the maintainers mailing list