Bug 762001 (GLUSTER-269) - Add a specialized STACK_UNWIND macro for each FOP
Summary: Add a specialized STACK_UNWIND macro for each FOP
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: GLUSTER-269
Product: GlusterFS
Classification: Community
Component: core
Version: mainline
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: shishir gowda
QA Contact:
URL:
Whiteboard:
: GLUSTER-401 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-09-17 09:24 UTC by Vikas Gorur
Modified: 2015-12-01 16:45 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:


Attachments (Terms of Use)

Description Vikas Gorur 2009-09-17 09:24:43 UTC
Add new macros such as STACK_UNWIND_LOOKUP, STACK_UNWIND_OPEN, and so on for each FOP so that the unwinds can be type-checked by the compiler.

Comment 1 Vikas Gorur 2009-10-05 08:05:54 UTC
A single macro STACK_UNWIND_STRICT (<fop>, args ...) will do the job, where <fop> is the name of the FOP.

Comment 2 Anand Avati 2009-10-05 09:16:53 UTC
PATCH: http://patches.gluster.com/patch/1666 in master (libglusterfs: Add STACK_UNWIND_STRICT macro.)

Comment 3 Anand Avati 2009-10-05 09:16:57 UTC
PATCH: http://patches.gluster.com/patch/1667 in master (storage/posix: Change STACK_UNWIND to STACK_UNWIND_STRICT.)

Comment 4 Anand Avati 2009-10-05 09:17:00 UTC
PATCH: http://patches.gluster.com/patch/1668 in master (features/locks: Change STACK_UNWIND to STACK_UNWIND_STRICT.)

Comment 5 Anand Avati 2009-10-07 07:31:00 UTC
PATCH: http://patches.gluster.com/patch/1724 in master (cluster/afr: Change STACK_UNWIND to STACK_UNWIND_STRICT.)

Comment 6 Anand Avati 2009-10-08 11:53:32 UTC
PATCH: http://patches.gluster.com/patch/1795 in master (cluster/dht: Change STACK_UNWIND to STACK_UNWIND_STRICT.)

Comment 7 Anand Avati 2009-10-08 11:53:36 UTC
PATCH: http://patches.gluster.com/patch/1831 in master (performance/write-behind: Change STACK_UNWIND to STACK_UNWIND_STRICT.)

Comment 8 Vikas Gorur 2009-11-11 10:50:08 UTC
This emacs-lisp script can help in doing the conversions:

(defconst fop-names '("stat" "readlink" "mknod" "mkdir" "unlink" "rmdir" "symlink" "rename" "link" "truncate" "open" "readv" "writev" "statfs" "flush" "fsync" "setxattr" "getxattr" "removexattr" "opendir" "getdents" "fsyncdir" "access" "create" "ftruncate" "fstat" "lk" "lookup" "setdents" "readdir" "inodelk" "finodelk" "entrylk" "fentrylk" "checksum" "xattrop" "fxattrop" "lock_notify" "lock_fnotify" "fgetxattr" "fsetxattr" "rchecksum" "setattr" "fsetattr" "readdirp"))

(defun fop-name (str)
  (let (ret)
    (dolist (name fop-names ret)
      (if (string-match (concat ".*" name ".*")
                        str)
          (setq ret name)))))

(defun vik-fop-name ()
  (let ((def (c-defun-name)))
    (fop-name def)))

(defun insert-fop-name ()
  (interactive)
  (insert (vik-fop-name)))

Comment 9 Raghavendra G 2009-11-23 20:57:01 UTC
*** Bug 401 has been marked as a duplicate of this bug. ***

Comment 10 Anand Avati 2009-11-24 09:36:52 UTC
PATCH: http://patches.gluster.com/patch/2333 in master (performance/stat-prefetch: use STACK_UNWIND_STRICT for unwinding.)

Comment 11 Anand Avati 2009-11-24 09:36:57 UTC
PATCH: http://patches.gluster.com/patch/2334 in master (performance/io-cache: use STACK_UNWIND_STRICT for unwinding.)

Comment 12 Anand Avati 2009-11-24 09:37:01 UTC
PATCH: http://patches.gluster.com/patch/2335 in master (performance/io-threads: use STACK_UNWIND_STRICT for unwinding.)

Comment 13 Anand Avati 2009-11-24 09:37:05 UTC
PATCH: http://patches.gluster.com/patch/2336 in master (performance/read-ahead: use STACK_UNWIND_STRICT for unwinding.)

Comment 14 Anand Avati 2009-11-24 09:37:09 UTC
PATCH: http://patches.gluster.com/patch/2337 in master (performance/write-behind: use STACK_UNWIND_STRICT for unwinding.)

Comment 15 Anand Avati 2009-11-24 09:37:13 UTC
PATCH: http://patches.gluster.com/patch/2338 in master (performance/quick-read: use STACK_UNWIND_STRICT for unwinding.)

Comment 16 Anand Avati 2010-01-23 09:47:33 UTC
PATCH: http://patches.gluster.com/patch/2680 in master (error-gen: change all STACK_UNWIND calls to STACK_UNWIND_STRICT)

Comment 17 Anand Avati 2010-01-23 19:31:02 UTC
PATCH: http://patches.gluster.com/patch/2687 in master (trace: multiple fixes)

Comment 18 Amar Tumballi 2010-07-19 06:33:06 UTC
Fix this in file by file manner, not in one big patch.. can be done between other fixes..

Comment 19 shishir gowda 2010-07-19 07:32:20 UTC
cluster/afr AFR_STACK_UNWIND in turn calls STACK_UNWIND_STRICT
cluster/dht DHT_STACK_UNWIND in turn calls STACK_UNWIND_STRICT

Comment 20 Amar Tumballi 2010-07-19 07:37:04 UTC
amar@supernova:~/work/glusterfs.git/xlators$ grep 'STACK_UNWIND ' * -r -l | grep -v afr | grep -v dht 
cluster/ha/src/ha.c
cluster/unify/src/unify.h
cluster/unify/src/unify-self-heal.c
cluster/unify/src/unify.c
cluster/map/src/map.c
debug/io-stats/src/io-stats.c
debug/error-gen/src/error-gen.c
encryption/rot-13/src/rot-13.c
features/path-convertor/src/path.c
features/filter/src/filter.c
features/quota/src/quota.c
features/trash/src/trash.c
features/trash/src/trash.h
features/locks/src/common.c
features/locks/src/posix.c
meta/src/misc.c
meta/src/view.c
meta/src/meta.c
mgmt/glusterd/src/glusterd-handler.c
performance/stat-prefetch/src/stat-prefetch.c
performance/symlink-cache/src/symlink-cache.c
performance/write-behind/src/write-behind.c
performance/quick-read/src/quick-read.c
protocol/legacy/client/src/client-protocol.c
storage/bdb/src/bdb.c

Out of this, only below files are in build in 'master'

debug/io-stats/src/io-stats.c
debug/error-gen/src/error-gen.c
encryption/rot-13/src/rot-13.c
features/filter/src/filter.c
features/quota/src/quota.c
features/trash/src/trash.c
features/trash/src/trash.h
features/locks/src/common.c
features/locks/src/posix.c
mgmt/glusterd/src/glusterd-handler.c
performance/stat-prefetch/src/stat-prefetch.c
performance/symlink-cache/src/symlink-cache.c
performance/write-behind/src/write-behind.c
performance/quick-read/src/quick-read.c

We need to fix above files. (preferably one at a time)

Comment 21 Anand Avati 2010-07-19 09:11:23 UTC
PATCH: http://patches.gluster.com/patch/3753 in master (debug/* Change STACK_UNWIND TO STACK_UNWIND_STRICT)

Comment 22 Anand Avati 2010-07-20 13:45:48 UTC
PATCH: http://patches.gluster.com/patch/3794 in master (features/trash convert STACK_UNWIND TO STACK_UNWIND STRICT)

Comment 23 Anand Avati 2010-07-20 13:45:52 UTC
PATCH: http://patches.gluster.com/patch/3795 in master (features/locks convert STACK_UNWIND to STACK_UNWIND_STRICT)

Comment 24 Anand Avati 2010-07-20 13:45:56 UTC
PATCH: http://patches.gluster.com/patch/3796 in master (performance/stat-prefetch convert STACK_UNWIND TO STACK_UNWIND_STRICT)

Comment 25 Anand Avati 2010-07-20 13:46:00 UTC
PATCH: http://patches.gluster.com/patch/3797 in master (performance/symlink-cache convert STACK_UNWIND to STACK_UNWIND_STRICT)

Comment 26 Anand Avati 2010-07-20 13:46:16 UTC
PATCH: http://patches.gluster.com/patch/3768 in master (encryption/ features/quota change STACK_UNWIND to STACK_UNWIND_STRICT)


Note You need to log in before you can comment on or make changes to this bug.